From d59df3a8fdb243f484687c16599a376a4479a50e Mon Sep 17 00:00:00 2001 From: Cameron Hudson Date: Tue, 31 Dec 2024 17:43:55 -0800 Subject: [PATCH 1/2] ci: try putting both jobs in the same file again --- .github/workflows/main.yml | 34 +++++++++++++++++++++++++++------- .github/workflows/pr.yml | 33 --------------------------------- 2 files changed, 27 insertions(+), 40 deletions(-) delete mode 100644 .github/workflows/pr.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6f69569..19fb30b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,21 +1,41 @@ name: main on: - push: + pull_request: + branches: + - main + push: branches: - main jobs: - deploy: + buildAndUpload: container: image: node:20 - environment: - name: github-pages - url: ${{ needs.buildAndUpload.outputs.artifactId }} - needs: buildAndUpload permissions: pages: write - id-token: write + id-token: write runs-on: ubuntu-latest steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Cache local downloads + uses: actions/cache@v4 + with: + path: /github/home/.npm + key: ${{ runner.os }}-npm-packages + - name: Install buildtime dependencies + run: npm ci + - name: Lint + run: npx eslint + - name: Test + run: npm test + - name: Compile + run: npm run build + - name: Upload static files as artifact + id: deployment + uses: actions/upload-artifact@v4 + with: + path: ./build/ - name: Deploy to GitHub Pages id: deployment + if: ${{ github.event_name == 'push' }} uses: actions/deploy-pages@v4 diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml deleted file mode 100644 index 8868945..0000000 --- a/.github/workflows/pr.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: pr -on: - pull_request: - branches: - - main -jobs: - buildAndUpload: - container: - image: node:20 - outputs: - artifactId: ${{ steps.deployment.outputs.artifact-id }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Cache local downloads - uses: actions/cache@v4 - with: - path: /github/home/.npm - key: ${{ runner.os }}-npm-packages - - name: Install buildtime dependencies - run: npm ci - - name: Lint - run: npx eslint - - name: Test - run: npm test - - name: Compile - run: npm run build - - name: Upload static files as artifact - id: deployment - uses: actions/upload-artifact@v4 - with: - path: ./build/ From 2e31b38ae4fecd51ea465032e82acd68387448f8 Mon Sep 17 00:00:00 2001 From: Cameron Hudson Date: Tue, 31 Dec 2024 17:47:59 -0800 Subject: [PATCH 2/2] Remove colliding step ids --- .github/workflows/main.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 19fb30b..df7ce34 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -31,11 +31,9 @@ jobs: - name: Compile run: npm run build - name: Upload static files as artifact - id: deployment uses: actions/upload-artifact@v4 with: path: ./build/ - name: Deploy to GitHub Pages - id: deployment if: ${{ github.event_name == 'push' }} uses: actions/deploy-pages@v4