-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (63 loc) · 1.93 KB
/
02-deploy-gh-pages.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Deploy to gh-pages
on:
workflow_call:
inputs:
release:
required: false
default: "false"
type: string
preRelease:
required: false
default: "false"
type: string
jobs:
deploy:
name: Deploy
runs-on: ubuntu-24.04 # Use Ubuntu 24.04 explicitly
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v4
- name: 🔄 Init Cache
uses: ./.github/actions/npm-cache
- name: ⬇️Download build
uses: actions/download-artifact@v4
with:
name: build
path: out
- name: ↔ Extract branch/tag name
shell: bash
env:
RELEASE: ${{ inputs.release }}
PRE_RELEASE: ${{ inputs.preRelease }}
BRANCH_NAME: ${{ steps.extract_branch.outputs.branch-name }}
run: |
if [[ $RELEASE == "true" || $PRE_RELEASE == "true" ]]
then
echo "name=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
else
echo "name=${BRANCH_NAME}" >> $GITHUB_OUTPUT
fi
id: extract
- name: 📛 Get repo name
uses: actions/github-script@v7
id: repo-name
with:
result-encoding: string
script: return context?.payload?.repository?.name
- name: 🔨 Build page
env:
RELEASE: ${{ inputs.release }}
PRE_RELEASE: ${{ inputs.preRelease }}
NAME: ${{ steps.extract.outputs.name }}
REPO_NAME: ${{ steps.repo-name.outputs.result }}
OWNER_NAME: ${{ github.repository_owner }}
run: |
chmod +rx ./.github/scripts/build-gh-page.sh
./.github/scripts/build-gh-page.sh
- name: 🥅 Deploy to GH-Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public