chore: sync from main #58
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Staging → GitHub Pages | |
| on: | |
| push: | |
| branches: | |
| - dev | |
| workflow_dispatch: | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: true | |
| jobs: | |
| # Skip deployment for sync commits from the bot | |
| check: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| should_deploy: ${{ steps.check.outputs.should_deploy }} | |
| steps: | |
| - name: Check if should deploy | |
| id: check | |
| env: | |
| COMMIT_MESSAGE: ${{ github.event.head_commit.message }} | |
| run: | | |
| if [[ "$COMMIT_MESSAGE" == "chore: sync from main" ]]; then | |
| echo "Skipping deployment for sync commit" | |
| echo "should_deploy=false" >> $GITHUB_OUTPUT | |
| else | |
| echo "should_deploy=true" >> $GITHUB_OUTPUT | |
| fi | |
| test: | |
| needs: [check] | |
| if: needs.check.outputs.should_deploy == 'true' | |
| uses: ./.github/workflows/test.yml | |
| build: | |
| runs-on: ubuntu-latest | |
| needs: [check, test] | |
| if: needs.check.outputs.should_deploy == 'true' | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "24" | |
| cache: "npm" | |
| - name: Install dependencies | |
| run: npm ci --ignore-scripts | |
| - name: Build | |
| run: npm run build | |
| env: | |
| DEPLOY_TARGET: github-pages | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v4 | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: ./dist | |
| deploy: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| needs: [check, build] | |
| if: needs.check.outputs.should_deploy == 'true' | |
| permissions: | |
| pages: write | |
| id-token: write | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |