Skip to content

Commit a6be226

Browse files
committed
Actions: Re-unify master and non-master workflow
1 parent 7309688 commit a6be226

File tree

2 files changed

+13
-80
lines changed

2 files changed

+13
-80
lines changed

.github/workflows/deploy.yaml renamed to .github/workflows/build.yaml

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,11 @@
11
name: build
22

33
on:
4-
push:
5-
branches:
6-
- "master"
7-
8-
permissions:
9-
contents: write
10-
pages: write
11-
id-token: write
4+
- pull_request
5+
- push
126

137
jobs:
148
build:
15-
environment:
16-
name: github-pages
17-
url: ${{ steps.deployment.outputs.page_url }}
189
runs-on: ubuntu-latest
1910
steps:
2011
- uses: actions/checkout@v4
@@ -53,6 +44,7 @@ jobs:
5344
globs: |
5445
docs/**/*.md
5546
README.md
47+
5648
- name: Stop and report errors
5749
run: |
5850
git add -A
@@ -66,18 +58,25 @@ jobs:
6658
mkdocs -v build
6759
: > site/.nojekyll
6860
echo -n '201.ustclug.org' > site/CNAME
61+
6962
- name: Upload artifact
70-
if: github.ref == 'refs/heads/master'
7163
uses: actions/upload-pages-artifact@v3
7264
with:
7365
path: site
66+
67+
deploy:
68+
needs: build
69+
if: github.ref == 'refs/heads/master'
70+
environment:
71+
name: github-pages
72+
url: ${{ steps.deployment.outputs.page_url }}
73+
runs-on: ubuntu-latest
74+
steps:
7475
- name: Deploy to GitHub Pages
75-
if: github.ref == 'refs/heads/master'
7676
id: deployment
7777
uses: actions/deploy-pages@v4
7878

7979
- name: Push site to gh-pages branch
80-
if: github.ref == 'refs/heads/master'
8180
run: |
8281
CINFO="$(git log -1 --pretty="%an: [%h] %s")"
8382
git clone --depth=1 --branch=gh-pages --single-branch --no-checkout \

.github/workflows/non-master-check.yaml

Lines changed: 0 additions & 66 deletions
This file was deleted.

0 commit comments

Comments
 (0)