Skip to content

Commit 81478c4

Browse files
committed
gh action fix
1 parent c6f4f3f commit 81478c4

File tree

1 file changed

+43
-21
lines changed

1 file changed

+43
-21
lines changed

.github/workflows/deploy.yml

Lines changed: 43 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,55 @@
1-
name: Deploy to GitHub Pages
1+
# Simple workflow for deploying static content to GitHub Pages
2+
name: Deploy static content to Pages
23

34
on:
5+
# Runs on pushes targeting the default branch
46
push:
5-
branches:
6-
- main
7-
# Review gh actions docs if you want to further define triggers, paths, etc
8-
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
7+
branches: [main]
8+
9+
# Allows you to run this workflow manually from the Actions tab
10+
workflow_dispatch:
11+
12+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
13+
permissions:
14+
contents: read
15+
pages: write
16+
id-token: write
17+
18+
# Allow one concurrent deployment
19+
concurrency:
20+
group: "pages"
21+
cancel-in-progress: true
22+
23+
env:
24+
# Hosted GitHub runners have 7 GB of memory available, let's use 6 GB
25+
NODE_OPTIONS: --max-old-space-size=6144
926

1027
jobs:
28+
# Single deploy job since we're just deploying
1129
deploy:
12-
name: Deploy to GitHub Pages
30+
environment:
31+
name: github-pages
32+
url: ${{ steps.deployment.outputs.page_url }}
1333
runs-on: ubuntu-latest
1434
steps:
15-
- uses: actions/checkout@v3
16-
- uses: actions/setup-node@v3
35+
- name: Checkout
36+
uses: actions/checkout@v3
37+
- name: Set up Node.js
38+
uses: actions/setup-node@v3
1739
with:
18-
node-version: 18
40+
node-version: 16.x
1941
cache: yarn
20-
2142
- name: Install dependencies
22-
run: npm install
23-
- name: Build website
24-
run: npm run build
25-
26-
# Popular action to deploy to GitHub Pages:
27-
# Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus
28-
- name: Deploy to GitHub Pages
29-
uses: peaceiris/actions-gh-pages@v3
43+
run: yarn install --frozen-lockfile --non-interactive
44+
- name: Build
45+
run: yarn build
46+
- name: Setup Pages
47+
uses: actions/configure-pages@v1
48+
- name: Upload artifact
49+
uses: actions/upload-pages-artifact@v1
3050
with:
31-
github_token: ${{ secrets.GITHUB_TOKEN }}
32-
# Build output to publish to the `gh-pages` branch:
33-
publish_dir: ./build
51+
# Upload entire repository
52+
path: build
53+
- name: Deploy to GitHub Pages
54+
id: deployment
55+
uses: actions/deploy-pages@v1

0 commit comments

Comments
 (0)