Skip to content

Commit 59033e2

Browse files
author
Matthias Koeppe
committed
.github/workflows/doc-build.yml: Remove check for repo sagemath/sagetrac-mirror; deploy when NETLIFY_AUTH_TOKEN is set
1 parent adf85df commit 59033e2

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

.github/workflows/doc-build.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ jobs:
1515
build-docs:
1616
runs-on: ubuntu-latest
1717
container: ghcr.io/sagemath/sage/sage-docker-ubuntu-focal-standard-with-targets:dev
18-
if: github.repository == 'sagemath/sagetrac-mirror'
18+
env:
19+
CAN_DEPLOY: ${{ secrets.NETLIFY_AUTH_TOKEN != '' }}
1920
steps:
2021
- name: Checkout
2122
uses: actions/checkout@v3
@@ -33,6 +34,7 @@ jobs:
3334
SAGE_NUM_THREADS: 2
3435

3536
- name: Copy docs
37+
if: env.CAN_DEPLOY == 'true'
3638
run: |
3739
# For some reason the deploy step below cannot find /sage/...
3840
# So copy everything from there to local folder
@@ -42,7 +44,7 @@ jobs:
4244
4345
- name: Deploy to Netlify preview
4446
id: preview-netlify
45-
if: github.ref != 'refs/heads/develop'
47+
if: env.CAN_DEPLOY == 'true' && github.ref != 'refs/heads/develop'
4648
uses: netlify/actions/cli@master
4749
with:
4850
args: deploy --dir=docs --alias="${NETLIFY_ALIAS}"
@@ -60,7 +62,7 @@ jobs:
6062

6163
- name: Deploy to Netlify production
6264
id: deploy-netlify
63-
if: github.ref == 'refs/heads/develop'
65+
if: env.CAN_DEPLOY == 'true' && github.ref == 'refs/heads/develop'
6466
uses: netlify/actions/cli@master
6567
with:
6668
args: deploy --dir=docs --prod
@@ -69,5 +71,6 @@ jobs:
6971
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
7072

7173
- name: Report deployment url
74+
if: env.CAN_DEPLOY == 'true'
7275
run: |
7376
echo "::notice::The documentation has being automatically deployed to Netlify. %0A ✅ Preview: ${{ steps.preview-netlify.outputs.NETLIFY_URL || steps.deploy-netlify.outputs.NETLIFY_URL }}"

0 commit comments

Comments
 (0)