github actions

This commit is contained in:
Jing Hua 2023-03-04 07:44:02 +08:00
parent d6bfd2bc29
commit 35f52ea005

View file

@ -2,20 +2,17 @@ name: Deploy to GitHub Pages
on: on:
push: push:
branches: branches: [main]
- main
jobs: jobs:
deploy: deploy:
name: Deploy to GitHub Pages name: Deploy to GitHub Pages
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout repo - uses: actions/checkout@v3
uses: actions/checkout@v2
- name: Setup Node - name: Use Node.js 18
uses: actions/setup-node@v1 uses: actions/setup-node@v3
with: with:
node-version: 18 node-version: 18
@ -25,22 +22,10 @@ jobs:
- name: Build website - name: Build website
run: yarn build run: yarn build
- name: Upload production-ready build files
uses: actions/upload-artifact@v2
with:
name: production-files
path: ./dist
- name: deploy to GitHub Pages - name: deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3 uses: peaceiris/actions-gh-pages@v3
with: with:
github_token: ${{ secrets.GITHUB_TOKEN }} github_token: ${{ secrets.GITHUB_TOKEN }}
# Build output to publish to the `gh-pages` branch:
publish_dir: ./dist publish_dir: ./dist
# The following lines assign commit authorship to the official user_name: 'github-actions[bot]'
# GH-Actions bot for deploys to `gh-pages` branch: user_email: '41898282+github-actions[bot]@users.noreply.github.com'
# https://github.com/actions/checkout/issues/13#issuecomment-724415212
# The GH actions bot is used by default if you didn't specify the two fields.
# You can swap them out with your own user credentials.
user_name: github-actions[bot]
user_email: 41898282+github-actions[bot]@users.noreply.github.com