From 40781437d76c60b28ffa33b9744e5e5ddcaf406b Mon Sep 17 00:00:00 2001 From: RadiatedExodus Date: Wed, 15 Jan 2025 07:06:04 +0700 Subject: [PATCH] Workflow QoL improvements (#237) * 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 * Have the deploy workflows use the build workflow file instead --------- Signed-off-by: RadiatedExodus --- .github/workflows/build.yml | 1 + .github/workflows/deploy(legacy).yml | 31 --------------------------- .github/workflows/deploy.yml | 32 +++++++--------------------- .github/workflows/deploy_legacy.yml | 17 +++++++++++++++ 4 files changed, 26 insertions(+), 55 deletions(-) delete mode 100644 .github/workflows/deploy(legacy).yml create mode 100644 .github/workflows/deploy_legacy.yml 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(legacy).yml b/.github/workflows/deploy(legacy).yml deleted file mode 100644 index b30c919c..00000000 --- a/.github/workflows/deploy(legacy).yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Build And Deploy (Legacy [gh-pages]) -on: - push: - branches-ignore: - - gh-pages - workflow_dispatch: - # pull_request: -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: Deploy - uses: JamesIves/github-pages-deploy-action@4.1.5 - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main'}} - with: - BRANCH: gh-pages - FOLDER: docs - CLEAN: true diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 4d5dd152..3dfd2eb1 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,37 +1,21 @@ name: Build and Deploy on: + push: + branches: + - main 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 new file mode 100644 index 00000000..8ec5bfdf --- /dev/null +++ b/.github/workflows/deploy_legacy.yml @@ -0,0 +1,17 @@ +name: Build And Deploy (Legacy) +on: + workflow_dispatch: +jobs: + build: + name: Build + uses: ./.github/workflows/build.yml + deploy: + name: Deploy + steps: + - 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: + BRANCH: gh-pages + FOLDER: docs + CLEAN: true