Skip to content

Commit 2be7405

Browse files
committed
Simplify Pages Build workflow
1 parent 91a41ae commit 2be7405

File tree

1 file changed

+37
-16
lines changed

1 file changed

+37
-16
lines changed

.github/workflows/pages_build.yml

Lines changed: 37 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,48 @@ name: Pages Build
22
on:
33
push:
44
branches: [ main ]
5+
paths-ignore:
6+
- "README.md"
7+
- "README.txt"
8+
59
workflow_dispatch:
10+
11+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
18+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
19+
concurrency:
20+
group: "pages"
21+
cancel-in-progress: false
22+
623
jobs:
7-
build:
8-
name: Build GitHub Pages
24+
deploy:
25+
environment:
26+
name: github-pages
27+
url: ${{ steps.deployment.outputs.page_url }}
928
runs-on: windows-latest
1029
steps:
11-
- uses: actions/setup-node@v2
12-
with:
13-
node-version: 17.5.0
14-
- uses: actions/checkout@v2
30+
- name: Checkout
31+
uses: actions/checkout@v3
1532
with:
1633
fetch-depth: 0
17-
- name: Build and Commit
34+
- uses: actions/setup-node@v2
35+
with:
36+
node-version: '>=18.0'
37+
- name: Build
1838
run: |
19-
git config user.name "GitHub Actions"
20-
git config user.email "<>"
21-
git branch -f pages main
22-
git checkout pages
2339
npm ci
24-
git rm docs -f -r --ignore-unmatch
25-
npx gulp-cli build
26-
git add docs -f
27-
git commit -m "GitHub Actions"
28-
git push origin pages -f
40+
npx gulp build
41+
- name: Setup Pages
42+
uses: actions/configure-pages@v3
43+
- name: Upload artifact
44+
uses: actions/upload-pages-artifact@v1
45+
with:
46+
path: 'docs'
47+
- name: Deploy to GitHub Pages
48+
id: deployment
49+
uses: actions/deploy-pages@v2

0 commit comments

Comments
 (0)