Skip to content

Commit a19813c

Browse files
committed
CI: update deploy workflow
- Add concurrency to cancel in-progress jobs - Add checkout step to deploy job - Run workflow on all pushes, but only deploy on main
1 parent 54a9f8b commit a19813c

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

.github/workflows/deploy.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
name: Deploy docs
1+
name: Build and Deploy docs
22

33
on:
44
push:
5-
branches:
6-
- main
75
workflow_dispatch:
86

7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
10+
911
jobs:
1012
build:
1113
name: Build
1214
runs-on: ubuntu-latest
13-
defaults:
14-
run:
15-
working-directory: ./
16-
15+
permissions:
16+
contents: read
1717
steps:
1818
- name: Checkout repo
1919
uses: actions/checkout@v4
@@ -40,6 +40,8 @@ jobs:
4040
needs: build
4141
runs-on: ubuntu-latest
4242
if: github.ref == 'refs/heads/main'
43+
permissions:
44+
contents: write
4345

4446
steps:
4547
- name: Download artifact
@@ -52,4 +54,5 @@ jobs:
5254
uses: peaceiris/actions-gh-pages@v4
5355
with:
5456
github_token: ${{ secrets.GITHUB_TOKEN }}
55-
publish_dir: ./build
57+
publish_dir: ./build
58+

0 commit comments

Comments
 (0)