Skip to content

Commit 285cfad

Browse files
committed
build.yml action updates to not use deprecated actions and have safer conditions for running steps
1 parent 2e6b9b8 commit 285cfad

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build master
1+
name: Build main
22

33
on:
44
push:
@@ -40,18 +40,21 @@ jobs:
4040

4141
# Upload the static files
4242
- name: Upload documentation
43-
uses: actions/upload-pages-artifact@v2
43+
if: matrix.os == 'ubuntu-latest'
44+
uses: actions/upload-pages-artifact@v3
4445
with:
4546
path: ./output
4647

4748
# GitHub Actions recommends deploying in a separate job.
48-
build-docs:
49+
upload-docs:
4950
runs-on: ubuntu-latest
5051
needs: build
52+
# ensures that the job only runs when the workflow is triggered by a push event to the main branch
53+
if: github.ref == 'refs/heads/main'
5154
steps:
5255
- name: Deploy to GitHub Pages
5356
id: deployment
54-
uses: actions/deploy-pages@v2
57+
uses: actions/deploy-pages@v4
5558

5659
analyze:
5760
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)