[CI] Add required permissions for deploy token #10
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 | |
| on: | |
| push: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: 'Checkout code' | |
| uses: actions/checkout@v4 | |
| - name: 'Install Bun' | |
| uses: oven-sh/setup-bun@v2 | |
| - name: 'Install dependencies' | |
| run: bun install | |
| - name: 'Run tests' | |
| run: bun run lint | |
| - name: 'Build project' | |
| run: bun run build | |
| - name: 'Upload build artifacts' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: 'github-pages' | |
| path: './dist/*' | |
| deploy: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| permissions: | |
| id-token: write | |
| pages: write | |
| contents: write | |
| steps: | |
| - name: 'Checkout code' | |
| uses: actions/checkout@v4 | |
| - name: 'Getting artifacts' | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: 'github-pages' | |
| - name: 'Deploy to GitHub Pages' | |
| uses: JamesIves/github-pages-deploy-action@v4 | |
| with: | |
| branch: gh-pages | |
| folder: '.' |