Skip to content

infra: Fix github CI/CD push main :octocat: #18

infra: Fix github CI/CD push main :octocat:

infra: Fix github CI/CD push main :octocat: #18

Workflow file for this run

name: Publish to GitHub Pages CI/ CD
on:
push:
branches:
- main
build:
# At a minimum this job should upload artifacts using actions/upload-pages-artifact
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: Upload artifact for GitHub Pages
uses: actions/upload-pages-artifact@v1
with:
path: dist
deploy:
needs: build
# 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 }}
runs-on: ubuntu-latest
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 }}