File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 15
15
build-docs :
16
16
runs-on : ubuntu-latest
17
17
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 != '' }}
19
20
steps :
20
21
- name : Checkout
21
22
uses : actions/checkout@v3
33
34
SAGE_NUM_THREADS : 2
34
35
35
36
- name : Copy docs
37
+ if : env.CAN_DEPLOY == 'true'
36
38
run : |
37
39
# For some reason the deploy step below cannot find /sage/...
38
40
# So copy everything from there to local folder
42
44
43
45
- name : Deploy to Netlify preview
44
46
id : preview-netlify
45
- if : github.ref != 'refs/heads/develop'
47
+ if : env.CAN_DEPLOY == 'true' && github.ref != 'refs/heads/develop'
46
48
uses : netlify/actions/cli@master
47
49
with :
48
50
args : deploy --dir=docs --alias="${NETLIFY_ALIAS}"
60
62
61
63
- name : Deploy to Netlify production
62
64
id : deploy-netlify
63
- if : github.ref == 'refs/heads/develop'
65
+ if : env.CAN_DEPLOY == 'true' && github.ref == 'refs/heads/develop'
64
66
uses : netlify/actions/cli@master
65
67
with :
66
68
args : deploy --dir=docs --prod
69
71
NETLIFY_SITE_ID : ${{ secrets.NETLIFY_SITE_ID }}
70
72
71
73
- name : Report deployment url
74
+ if : env.CAN_DEPLOY == 'true'
72
75
run : |
73
76
echo "::notice::The documentation has being automatically deployed to Netlify. %0A ✅ Preview: ${{ steps.preview-netlify.outputs.NETLIFY_URL || steps.deploy-netlify.outputs.NETLIFY_URL }}"
You can’t perform that action at this time.
0 commit comments