Merge pull request #348 from hymccord/feat/auto-pop-cleanup #308
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: GitHub Pages | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request_target: | |
| workflow_dispatch: | |
| workflow_call: | |
| schedule: | |
| # every wednesday at 00:00 UTC | |
| - cron: '0 0 * * 3' | |
| # This allows a subsequently queued workflow run to interrupt previous runs | |
| concurrency: | |
| group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout PR | |
| if: ${{ github.event_name == 'pull_request_target' }} | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.pull_request.head.ref }} | |
| repository: ${{ github.event.pull_request.head.repo.full_name }} | |
| - name: Checkout | |
| if: ${{ github.event_name != 'pull_request_target' }} | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: master | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v4 | |
| - name: Use Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| - name: Update npm to latest | |
| run: npm i --prefer-online --no-fund --no-audit -g npm@latest | |
| - run: npm -v | |
| - run: npm i --ignore-scripts --no-audit --no-fund --package-lock | |
| - run: npm run puppeteer | |
| - run: npm run build | |
| - run: npm run timestamp | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - run: npm run sample | |
| - run: ./build/deploy.sh | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: './out' | |
| deploy: | |
| if: ${{ github.event_name != 'pull_request_target' && contains(fromJSON('["refs/heads/master", "refs/heads/main"]'), github.ref) }} | |
| runs-on: ubuntu-latest | |
| needs: build | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| permissions: | |
| pages: write | |
| id-token: write | |
| outputs: | |
| deployment_url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 | |
| # internal-only alpha, not available yet: https://github.com/actions/deploy-pages/pull/61 | |
| # with: | |
| # preview: ${{ github.event_name == 'pull_request_target' }} |