Skip to content

Commit c5b3304

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 c5b3304

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

.github/workflows/deploy.yml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +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:
13+
permissions:
14+
contents: read
15+
pages: write
16+
id-token: write
1117
name: Build
1218
runs-on: ubuntu-latest
1319
defaults:
@@ -36,12 +42,19 @@ jobs:
3642
path: ./build
3743

3844
deploy:
45+
permissions:
46+
contents: read
47+
pages: write
48+
id-token: write
3949
name: Deploy
4050
needs: build
4151
runs-on: ubuntu-latest
4252
if: github.ref == 'refs/heads/main'
4353

4454
steps:
55+
- name: Checkout repo
56+
uses: actions/checkout@v4
57+
4558
- name: Download artifact
4659
uses: actions/download-artifact@v4
4760
with:
@@ -52,4 +65,5 @@ jobs:
5265
uses: peaceiris/actions-gh-pages@v4
5366
with:
5467
github_token: ${{ secrets.GITHUB_TOKEN }}
55-
publish_dir: ./build
68+
publish_dir: ./build
69+

0 commit comments

Comments
 (0)