From 6b6f4b75e74949d7641865320148dfb1b0397151 Mon Sep 17 00:00:00 2001 From: RadiatedExodus Date: Tue, 14 Jan 2025 00:19:27 +0700 Subject: [PATCH 1/2] Fix workflow trigger events - Renamed legacy deployment file - Removed on push trigger on legacy deployment - Added on push trigger on the new deployment trigger Signed-off-by: RadiatedExodus --- .github/workflows/deploy.yml | 3 +++ .github/workflows/{deploy(legacy).yml => deploy_legacy.yml} | 6 +----- 2 files changed, 4 insertions(+), 5 deletions(-) rename .github/workflows/{deploy(legacy).yml => deploy_legacy.yml} (86%) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 4d5dd152..8071b180 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,5 +1,8 @@ name: Build and Deploy on: + push: + branches: + - main workflow_dispatch: jobs: build: diff --git a/.github/workflows/deploy(legacy).yml b/.github/workflows/deploy_legacy.yml similarity index 86% rename from .github/workflows/deploy(legacy).yml rename to .github/workflows/deploy_legacy.yml index b30c919c..303c46e4 100644 --- a/.github/workflows/deploy(legacy).yml +++ b/.github/workflows/deploy_legacy.yml @@ -1,10 +1,6 @@ -name: Build And Deploy (Legacy [gh-pages]) +name: Build And Deploy (Legacy) on: - push: - branches-ignore: - - gh-pages workflow_dispatch: - # pull_request: jobs: build: name: Build and Deploy From 27837fc0310c82d652119001b6662fcad41f9607 Mon Sep 17 00:00:00 2001 From: RadiatedExodus Date: Tue, 14 Jan 2025 00:30:00 +0700 Subject: [PATCH 2/2] Have the deploy workflows use the build workflow file instead --- .github/workflows/build.yml | 1 + .github/workflows/deploy.yml | 29 +++++------------------------ .github/workflows/deploy_legacy.yml | 20 +++++--------------- 3 files changed, 11 insertions(+), 39 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a0921b47..9d10370d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,7 @@ name: Build on: workflow_dispatch: + workflow_call: pull_request: jobs: build: diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 8071b180..3dfd2eb1 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -6,35 +6,16 @@ on: workflow_dispatch: jobs: build: - name: Build and Deploy - runs-on: ubuntu-latest - steps: - - name: Checkout Repository - uses: actions/checkout@v2 - with: - fetch-depth: '0' - persist-credentials: false - submodules: 'recursive' - - name: Setup Node - uses: actions/setup-node@v2-beta - with: - node-version: '22' - - name: Build - run: npm install && npm run build - - name: Upload static files as artifact - id: deployment - uses: actions/upload-pages-artifact@v3 # or specific "vX.X.X" version tag for this action - with: - path: docs + name: Build + uses: ./.github/workflows/build.yml deploy: - environment: - name: Deploy + name: Deploy + runs-on: ubuntu-latest + needs: build permissions: contents: read pages: write id-token: write - runs-on: ubuntu-latest - needs: build steps: - name: Deploy to GitHub Pages id: deployment diff --git a/.github/workflows/deploy_legacy.yml b/.github/workflows/deploy_legacy.yml index 303c46e4..8ec5bfdf 100644 --- a/.github/workflows/deploy_legacy.yml +++ b/.github/workflows/deploy_legacy.yml @@ -3,22 +3,12 @@ on: workflow_dispatch: jobs: build: - name: Build and Deploy - runs-on: ubuntu-latest + name: Build + uses: ./.github/workflows/build.yml + deploy: + name: Deploy steps: - - name: Checkout Repository - uses: actions/checkout@v2 - with: - fetch-depth: '0' - persist-credentials: false - submodules: 'recursive' - - name: Setup Node - uses: actions/setup-node@v2-beta - with: - node-version: '22' - - name: Build - run: npm install && npm run build - - name: Deploy + - name: Deploy to GitHub Pages (gh-pages branch) uses: JamesIves/github-pages-deploy-action@4.1.5 if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main'}} with: