Skip to content

Commit

Permalink
infra: Fix github page deploy :octocat:
Browse files Browse the repository at this point in the history
  • Loading branch information
wh1t3h47 committed Sep 11, 2024
1 parent 2532177 commit 6bb23fd
Showing 1 changed file with 28 additions and 24 deletions.
52 changes: 28 additions & 24 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,46 @@
on:
push:
branches:
- main

permissions:
contents: read
pages: write
id-token: write

jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deploy.outputs.page_url }}
build:
# At a minimum this job should upload artifacts using actions/upload-pages-artifact

steps:
# Checkout project repository
- name: Checkout
uses: actions/checkout@v3

# Setup Node.js environment
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "16.x"

# Install dependencies
- name: Install dependencies
run: yarn install --prefer-offline

# Build Application
- name: Build application
run: yarn build

# Deploy to Github Pages
- id: deploy
name: Deploy to Github Pages
uses: fcodelabs/[email protected]
- 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:
Expand Down

0 comments on commit 6bb23fd

Please sign in to comment.