Build and Trigger Deploy #53
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: Build and Trigger Deploy | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths-ignore: | |
| - .github/** | |
| - .vscode/** | |
| - .devcontainer/** | |
| - .gitignore | |
| workflow_dispatch: | |
| repository_dispatch: | |
| types: | |
| - content_changed | |
| jobs: | |
| Build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Restore content from cache | |
| uses: actions/cache/restore@v4 | |
| with: | |
| restore-keys: content- | |
| path: cache/ | |
| key: "_" | |
| - name: Build project | |
| run: npm run build | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.PRIVILEGED_GITHUB_TOKEN }} | |
| - name: Add .nojekyll file | |
| run: touch dist/.nojekyll | |
| - name: Deploy to GitHub Pages | |
| uses: crazy-max/ghaction-github-pages@v4 | |
| with: | |
| target_branch: gh-pages | |
| build_dir: dist | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.PRIVILEGED_GITHUB_TOKEN }} |