infra: Fix github CI/CD artifact #20
This file contains 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: Publish to GitHub Pages CI/CD | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "16.x" | |
- name: Install dependencies | |
run: yarn install --prefer-offline | |
- name: Build application | |
run: yarn build | |
- name: github-pages | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
path: dist | |
deploy: | |
needs: build | |
runs-on: ubuntu-latest | |
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment | |
permissions: | |
pages: write # to deploy to Pages | |
id-token: write # to verify the deployment originates from an appropriate source | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 # or "vX.X.X" version | |
with: | |
build_dir: dist | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |