Skip to content

Commit

Permalink
GitHub Actions: use actions/deploy-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
simon04 committed Dec 2, 2023
1 parent f52199c commit 2f60b9e
Showing 1 changed file with 28 additions and 7 deletions.
35 changes: 28 additions & 7 deletions .github/workflows/node-ci.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,41 @@
name: Node CI

on: [push]
on:
push:
pull_request:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '20'
- run: yarn install --no-progress --frozen-lockfile
- run: yarn test
- run: yarn build
- uses: peaceiris/actions-gh-pages@v3
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
- uses: actions/configure-pages@v3
- uses: actions/upload-pages-artifact@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
path: ./dist

deploy:
runs-on: ubuntu-latest
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref == 'refs/heads/master')
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: 'pages'
cancel-in-progress: true
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2

0 comments on commit 2f60b9e

Please sign in to comment.