From c356742f19425e2973ced6c16a1a0931a5a3bd4a Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Thu, 22 Jan 2026 09:24:10 -0500 Subject: [PATCH 1/4] fix ci --- .github/workflows/ci.yaml | 49 ++++++++++++++++++++++++++++---- .github/workflows/deploy.yaml | 53 ----------------------------------- 2 files changed, 44 insertions(+), 58 deletions(-) delete mode 100644 .github/workflows/deploy.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 2f4de83..0166e1b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,15 +1,12 @@ -name: CI +name: CI + Deploy on: - pull_request: - branches: [main] push: branches: [main] jobs: - lint: + ci: runs-on: ubuntu-latest - steps: - name: Checkout uses: actions/checkout@v4 @@ -34,3 +31,45 @@ jobs: - name: Build run: pnpm build + + deploy: + needs: ci + if: github.ref == 'refs/heads/main' + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup PNPM + uses: pnpm/action-setup@v4 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: "pnpm" + + - name: Install dependencies + run: pnpm install + + - name: Build site + run: pnpm build + + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v2 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: us-east-2 + + - name: Deploy static site to S3 bucket + run: | + chmod +x scripts/deploy.sh + scripts/deploy.sh + + - name: Invalidate CloudFront cache + env: + AWS_CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID }} + run: | + chmod +x scripts/invalidate.sh + scripts/invalidate.sh diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml deleted file mode 100644 index 8e4f25b..0000000 --- a/.github/workflows/deploy.yaml +++ /dev/null @@ -1,53 +0,0 @@ -name: Deploy to AWS S3 - -on: - workflow_run: - workflows: ["CI"] - types: - - completed - -jobs: - deploy: - if: > - github.event.workflow_run.conclusion == 'success' && - github.event.workflow_run.head_branch == 'main' - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Setup PNPM - uses: pnpm/action-setup@v2 - with: - version: 8 - - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version: 18 - cache: "pnpm" - - - name: Install dependencies - run: pnpm install - - - name: Build site - run: pnpm build - - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v2 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: us-east-2 - - - name: Deploy static site to S3 bucket - run: | - chmod +x scripts/deploy.sh - scripts/deploy.sh - - - name: Invalidate CloudFront cache - env: - AWS_CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID }} - run: | - chmod +x scripts/invalidate.sh - scripts/invalidate.sh From 30bca2f8ba9f129c112af3d52e8457ad367ec043 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Thu, 22 Jan 2026 09:29:40 -0500 Subject: [PATCH 2/4] actual fix --- .github/workflows/ci.yaml | 73 +++++------------------------------ .github/workflows/deploy.yaml | 34 ++++++++++++++++ 2 files changed, 44 insertions(+), 63 deletions(-) create mode 100644 .github/workflows/deploy.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0166e1b..7eeb30b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,6 +1,8 @@ -name: CI + Deploy +name: CI on: + pull_request: + branches: [main] push: branches: [main] @@ -8,68 +10,13 @@ jobs: ci: runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup PNPM - uses: pnpm/action-setup@v4 - - - name: Setup Node - uses: actions/setup-node@v4 + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 + - uses: actions/setup-node@v4 with: node-version: 20 cache: "pnpm" - - - name: Install dependencies - run: pnpm install - - - name: Prettier check - run: pnpm prettier --check . - - - name: Astro check - run: pnpm astro check - - - name: Build - run: pnpm build - - deploy: - needs: ci - if: github.ref == 'refs/heads/main' - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup PNPM - uses: pnpm/action-setup@v4 - - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version: 20 - cache: "pnpm" - - - name: Install dependencies - run: pnpm install - - - name: Build site - run: pnpm build - - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v2 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: us-east-2 - - - name: Deploy static site to S3 bucket - run: | - chmod +x scripts/deploy.sh - scripts/deploy.sh - - - name: Invalidate CloudFront cache - env: - AWS_CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID }} - run: | - chmod +x scripts/invalidate.sh - scripts/invalidate.sh + - run: pnpm install + - run: pnpm prettier --check . + - run: pnpm astro check + - run: pnpm build diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml new file mode 100644 index 0000000..b2fdea6 --- /dev/null +++ b/.github/workflows/deploy.yaml @@ -0,0 +1,34 @@ +name: Deploy + +on: + workflow_run: + workflows: ["CI"] + types: + - completed + +jobs: + deploy: + if: > + github.event.workflow_run.conclusion == 'success' && + github.event.workflow_run.pull_requests[0].base.ref == 'main' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: "pnpm" + - run: pnpm install + - run: pnpm build + - uses: aws-actions/configure-aws-credentials@v2 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: us-east-2 + - run: | + chmod +x scripts/deploy.sh + scripts/deploy.sh + - run: | + chmod +x scripts/invalidate.sh + scripts/invalidate.sh From a9f8a3dcb22bf5b521d6dc1d34f9ba464540cb74 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Thu, 22 Jan 2026 09:30:18 -0500 Subject: [PATCH 3/4] fiox --- .github/workflows/ci.yaml | 2 -- .github/workflows/deploy.yaml | 10 ++-------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7eeb30b..e2aa435 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,5 +1,3 @@ -name: CI - on: pull_request: branches: [main] diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index b2fdea6..5fe25d8 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -1,5 +1,3 @@ -name: Deploy - on: workflow_run: workflows: ["CI"] @@ -26,9 +24,5 @@ jobs: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-region: us-east-2 - - run: | - chmod +x scripts/deploy.sh - scripts/deploy.sh - - run: | - chmod +x scripts/invalidate.sh - scripts/invalidate.sh + - run: chmod +x scripts/deploy.sh && scripts/deploy.sh + - run: chmod +x scripts/invalidate.sh && scripts/invalidate.sh From b29c120ef89df2dd64365c757ad74f1a18f43ff4 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Thu, 22 Jan 2026 09:30:57 -0500 Subject: [PATCH 4/4] fix(ci): name the workflows --- .github/workflows/ci.yaml | 1 + .github/workflows/deploy.yaml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e2aa435..938ba93 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,3 +1,4 @@ +name: ci on: pull_request: branches: [main] diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 5fe25d8..50551cc 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -1,3 +1,4 @@ +name: deploy on: workflow_run: workflows: ["CI"]