Skip to content

Commit

Permalink
ci: replace the gh-pages action from peaceiris' one to actions/deploy…
Browse files Browse the repository at this point in the history
…-pages

Also simplify jobs considering `prepare` script
  • Loading branch information
0b5vr committed Nov 9, 2023
1 parent f2e1431 commit dccdc29
Showing 1 changed file with 13 additions and 39 deletions.
52 changes: 13 additions & 39 deletions .github/workflows/gh-pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,58 +10,32 @@ defaults:
shell: bash

jobs:
fetch:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16'
cache: 'yarn'
- name: Fetch Deps
run: yarn

build:
runs-on: ubuntu-latest
needs: fetch
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16'
cache: 'yarn'
- name: Fetch Deps
- name: Install + Prepare
run: yarn
- name: Build
run: yarn build
- name: Upload Builds
uses: actions/upload-artifact@v2
uses: actions/upload-pages-artifact@v2
with:
name: build
path: |
dist/
path: dist

pages:
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/main' }}
needs:
- build
- build
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
path: artifacts
- name: Setup Pages
run: |
mkdir pages
mv README.md pages
mv LICENSE.txt pages
mv package.json pages
mv index.html pages
mv artifacts/build/* pages
- name: Publish gh-pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: pages
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v2

0 comments on commit dccdc29

Please sign in to comment.