Skip to content

Commit

Permalink
Update infra references
Browse files Browse the repository at this point in the history
  • Loading branch information
danielnaab committed Jul 18, 2024
1 parent c76c642 commit 7d70496
Show file tree
Hide file tree
Showing 8 changed files with 344 additions and 283 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/_terraform-apply.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:

- name: Initialize Terraform CDK configuration
shell: bash
working-directory: infra
working-directory: infra/cdktf
run: |
pnpm cdktf get
pnpm build:tsc
Expand All @@ -68,7 +68,7 @@ jobs:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
shell: bash
working-directory: infra
working-directory: infra/cdktf
run: |
cf api https://api.fr.cloud.gov
DEPLOY_ENV=${DEPLOY_ENV} pnpm cdktf deploy --auto-approve
8 changes: 4 additions & 4 deletions .github/workflows/_terraform-plan-pr-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:

- name: Initialize Terraform CDK configuration
shell: bash
working-directory: infra
working-directory: infra/cdktf
run: |
pnpm cdktf get
pnpm build:tsc
Expand All @@ -70,19 +70,19 @@ jobs:
cf api https://api.fr.cloud.gov
- name: Synthesize Terraform configuration
working-directory: infra
working-directory: infra/cdktf
run: |
DEPLOY_ENV=${DEPLOY_ENV} pnpm cdktf synth
- name: Get Terraform stack name
id: get_stack_name
working-directory: infra
working-directory: infra/cdktf
run: |
DEPLOY_ENV=${DEPLOY_ENV} pnpm cdktf output --outputs-file outputs.json
echo "stack_name=$(jq -r 'keys[0]' outputs.json)" >> $GITHUB_OUTPUT
- name: Create Terraform plan
uses: dflook/terraform-plan@v1
with:
path: infra/cdktf.out/stacks/${{ steps.get_stack_name.outputs.stack_name }}
path: infra/cdktf/cdktf.out/stacks/${{ steps.get_stack_name.outputs.stack_name }}
label: ${{ steps.get_stack_name.outputs.stack_name }}
5 changes: 4 additions & 1 deletion apps/spotlight/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@ const githubRepository = await getGithubRepository(process.env);

// https://astro.build/config
export default defineConfig({
trailingSlash: 'always',
base: addTrailingSlash(process.env.BASEURL || ''),
integrations: [
react({
include: ['src/components/react/**'],
}),
],
security: {
checkOrigin: true,
},
trailingSlash: 'always',
vite: {
define: {
'import.meta.env.GITHUB': JSON.stringify(githubRepository),
Expand Down
2 changes: 0 additions & 2 deletions packages/server/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { defineConfig } from 'astro/config';
import auth from 'auth-astro';
import node from '@astrojs/node';
import react from '@astrojs/react';

Expand All @@ -19,7 +18,6 @@ export default defineConfig({
react({
include: ['src/components/react/**'],
}),
auth(),
],
server: {
port: 4322,
Expand Down
4 changes: 2 additions & 2 deletions packages/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
"@astrojs/react": "^3.6.0",
"@atj/design": "workspace:*",
"@atj/forms": "workspace:*",
"@auth/core": "^0.32.0",
"astro": "^4.10.3",
"auth-astro": "^4.1.2",
"better-sqlite3": "^11.1.2",
"express": "^4.19.2",
"lucia": "^3.2.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-error-boundary": "^4.0.12",
Expand Down
20 changes: 20 additions & 0 deletions packages/server/src/auth.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
import { Lucia } from 'lucia';
const adapter = new BetterSQLite3Adapter(db);
export const lucia = new Lucia(adapter, {
sessionCookie: {
attributes: {
// set to `true` when using HTTPS
secure: import.meta.env.PROD,
},
},
});
declare module 'lucia' {
interface Register {
Lucia: typeof lucia;
}
}
*/
11 changes: 1 addition & 10 deletions packages/server/src/components/Header.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
---
import { getSession } from 'auth-astro/server';
import closeSvg from '@atj/design/static/uswds/img/usa-icons/close.svg';
import logoSvg from '@atj/design/images/logo.svg';
Expand All @@ -17,7 +15,7 @@ const getNavLinkClasses = (url: string) => {
}
};
const session = await getSession(Astro.request);
const session = null;
---

<div class="usa-overlay"></div>
Expand Down Expand Up @@ -72,10 +70,3 @@ const session = await getSession(Astro.request);
</div>
</nav>
</header>
<script>
const { signIn, signOut } = await import('auth-astro/client');
document
.querySelector('#login')
?.addEventListener('click', () => signIn('login-gov'));
document.querySelector('#logout')?.addEventListener('click', () => signOut());
</script>
Loading

0 comments on commit 7d70496

Please sign in to comment.