Skip to content

Commit

Permalink
Migrate to GHA-based GHP deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
xingrz committed Mar 23, 2024
1 parent 81107f5 commit 3228a8a
Showing 1 changed file with 29 additions and 14 deletions.
43 changes: 29 additions & 14 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,52 @@ name: Auto deploy

on:
push:
branches: [ v4 ]
branches: [ master ]

concurrency:
group: pages
cancel-in-progress: true

jobs:
deploy:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 2

- uses: benjlevesque/[email protected]
id: short-sha

- name: Set up Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: '16'
cache: 'npm'

- name: Build
run: npm ci && npm run build

- name: Publish
uses: crazy-max/ghaction-github-pages@v2
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
target_branch: gh-pages
keep_history: true
allow_empty_commit: false
build_dir: dist
commit_message: "Auto deploy for commit ${{ steps.short-sha.outputs.sha }}"
fqdn: rdt.xingrz.me
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
path: dist

deploy:
needs: build

permissions:
pages: write
id-token: write

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

0 comments on commit 3228a8a

Please sign in to comment.