Deploy to GitHub Pages #65
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: Deploy to GitHub Pages | |
| on: | |
| # Allows you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| # Runs when CI passes | |
| workflow_run: | |
| workflows: [CI] | |
| branches: [main] | |
| types: [completed] | |
| # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| # Allow one concurrent deployment, and never cancel one in flight | |
| concurrency: | |
| group: deploy | |
| cancel-in-progress: false | |
| jobs: | |
| deploy: | |
| if: github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup pages | |
| uses: actions/configure-pages@v6 | |
| - name: Set up pnpm | |
| uses: pnpm/action-setup@v6 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| cache: pnpm | |
| node-version-file: .nvmrc | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build | |
| run: pnpm run build | |
| env: | |
| VITE_SENTRY_DSN: ${{ secrets.SENTRY_DSN }} | |
| VITE_SENTRY_RELEASE: ${{ github.sha }} | |
| # Sourcemaps must reach Sentry BEFORE they are deleted. Do not reorder. | |
| - name: Create Sentry release | |
| uses: getsentry/action-release@v3 | |
| env: | |
| SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
| SENTRY_ORG: timcodes | |
| SENTRY_PROJECT: fourtiles | |
| with: | |
| environment: production | |
| release: ${{ github.sha }} | |
| sourcemaps: './dist' | |
| # Sourcemaps must not reach the public. Do not reorder. | |
| - name: Strip source maps from the published artifact | |
| run: find dist -name '*.map' -delete | |
| - name: Upload | |
| uses: actions/upload-pages-artifact@v5 | |
| with: | |
| path: 'dist/' | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v5 |