|
3 | 3 | branches:
|
4 | 4 | - main
|
5 | 5 | pull_request:
|
6 |
| - branches: |
7 |
| - - main |
8 |
| - release: |
9 |
| - types: |
10 |
| - - published |
11 |
| - - released |
| 6 | + workflow_dispatch: |
| 7 | + |
| 8 | +permissions: |
| 9 | + contents: read |
| 10 | + pages: write |
| 11 | + id-token: write |
| 12 | + |
| 13 | +concurrency: |
| 14 | + group: "pages" |
| 15 | + cancel-in-progress: false |
12 | 16 |
|
13 | 17 | name: Build and deploy sites
|
14 | 18 |
|
15 | 19 | jobs:
|
16 | 20 | build:
|
17 | 21 | name: Build site and generate HTML
|
18 | 22 | runs-on: ubuntu-latest
|
19 |
| - outputs: |
20 |
| - ref-url: ${{ steps.deploy.outputs.deploy-url }} |
21 | 23 |
|
22 | 24 | steps:
|
23 | 25 | - name: Install deps for figures (OS packages)
|
@@ -102,100 +104,24 @@ jobs:
|
102 | 104 | fail: true
|
103 | 105 | args: --base './_out/html-multi/' --no-progress --offline './_out/html-multi/**/*.html'
|
104 | 106 |
|
105 |
| - # deploy-alias computes a URL component for the PR preview. This |
106 |
| - # is so we can have a stable name to use for feedback on draft |
107 |
| - # material. |
108 |
| - - id: deploy-alias |
109 |
| - uses: actions/github-script@v7 |
110 |
| - name: Compute Alias |
111 |
| - with: |
112 |
| - script: | |
113 |
| - if (process.env.PR) { |
114 |
| - return `pr-${process.env.PR}` |
115 |
| - } else { |
116 |
| - return 'deploy-preview-main'; |
117 |
| - } |
118 |
| - env: |
119 |
| - PR: ${{ github.event.number }} |
120 |
| - |
121 |
| - # deploy-info computes metadata that's shown in the Netlify interface |
122 |
| - # about the deployment (for non-PR deploys) |
123 |
| - - id: deploy-info |
124 |
| - name: Compute Deployment Metadata |
125 |
| - if: github.event_name != 'pull_request' |
126 |
| - run: | |
127 |
| - set -e |
128 |
| - echo "message=$(git log -1 --pretty=format:"%s")" >> "$GITHUB_OUTPUT" |
129 |
| -
|
130 |
| - # When a release is created in GH, push to the main site without proofreading info |
131 |
| - - name: Deploy releases when tags are pushed |
132 |
| - id: deploy-release |
133 |
| - |
134 |
| - if: github.event_name == 'release' |
| 107 | + - name: Upload artifact |
| 108 | + uses: actions/upload-pages-artifact@v3 |
135 | 109 | with:
|
136 |
| - publish-dir: _out/html-multi |
137 |
| - production-branch: main |
138 |
| - production-deploy: true |
139 |
| - github-token: ${{ secrets.GITHUB_TOKEN }} |
140 |
| - deploy-message: | |
141 |
| - Release from tag ${{ github.ref }} |
142 |
| - enable-commit-comment: false |
143 |
| - enable-pull-request-comment: false |
144 |
| - fails-without-credentials: true |
145 |
| - env: |
146 |
| - NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} |
147 |
| - NETLIFY_SITE_ID: "447031bf-9a96-4cee-831b-1f73599a7cb2" |
148 |
| - |
149 |
| - # When pushing to `main` or a PR branch, deploy what it would look like if this were released |
150 |
| - - name: Deploy current draft |
151 |
| - id: deploy-draft |
152 |
| - |
153 |
| - if: github.event_name == 'push' || github.event_name == 'pull_request' |
154 |
| - with: |
155 |
| - publish-dir: _out/html-multi |
156 |
| - production-branch: main |
157 |
| - production-deploy: true |
158 |
| - github-token: ${{ secrets.GITHUB_TOKEN }} |
159 |
| - deploy-message: | |
160 |
| - ${{ github.event_name == 'pull_request' && format('pr#{0}: {1}', github.event.number, github.event.pull_request.title) || format('ref/{0}: {1}', github.ref_name, steps.deploy-info.outputs.message) }} |
161 |
| - alias: ${{ steps.deploy-alias.outputs.result }} |
162 |
| - enable-commit-comment: false |
163 |
| - enable-pull-request-comment: false |
164 |
| - github-deployment-environment: | |
165 |
| - ${{ github.event_name == 'pull_request' && format('lean-ref-pr-#{0}', github.event.number) || 'lean-ref' }} |
166 |
| - github-deployment-description: | |
167 |
| - Draft without proofreading info |
168 |
| - fails-without-credentials: true |
169 |
| - env: |
170 |
| - NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} |
171 |
| - NETLIFY_SITE_ID: "32e0f63e-7a18-4bf9-87f4-713650c7db70" |
172 |
| - |
173 |
| - # When pushing to `main` or a PR branch, deploy it with proofreading info as well |
174 |
| - - name: Deploy with proofreading info (draft mode, for PRs) |
175 |
| - id: deploy-draft-proofreading |
176 |
| - |
177 |
| - if: |
178 |
| - github.event_name == 'pull_request' |
179 |
| - with: |
180 |
| - publish-dir: _out/draft/html-multi |
181 |
| - production-branch: main |
182 |
| - production-deploy: false |
183 |
| - github-token: ${{ secrets.GITHUB_TOKEN }} |
184 |
| - deploy-message: | |
185 |
| - ${{ github.event_name == 'pull_request' && format('pr#{0} proofreading: {1}', github.event.number, github.event.pull_request.title) }} |
186 |
| - alias: draft-${{ steps.deploy-alias.outputs.result }} |
187 |
| - enable-commit-comment: false |
188 |
| - enable-pull-request-comment: false |
189 |
| - github-deployment-environment: | |
190 |
| - ${{ github.event_name == 'pull_request' && format('lean-ref-pr-draft-#{0}', github.event.number) }} |
191 |
| - github-deployment-description: | |
192 |
| - Draft with proofreading info |
193 |
| - fails-without-credentials: true |
194 |
| - env: |
195 |
| - NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} |
196 |
| - NETLIFY_SITE_ID: "32e0f63e-7a18-4bf9-87f4-713650c7db70" |
197 |
| - |
198 |
| - |
| 110 | + path: _out/html-multi |
| 111 | + |
| 112 | + # Deployment job |
| 113 | + deploy: |
| 114 | + if: github.ref == 'refs/heads/main' |
| 115 | + environment: |
| 116 | + name: github-pages |
| 117 | + url: ${{ steps.deployment.outputs.page_url }} |
| 118 | + runs-on: ubuntu-latest |
| 119 | + needs: build |
| 120 | + steps: |
| 121 | + - name: Deploy to GitHub Pages |
| 122 | + id: deployment |
| 123 | + uses: actions/deploy-pages@v4 |
| 124 | + |
199 | 125 |
|
200 | 126 | check-links:
|
201 | 127 | name: Check links
|
|
0 commit comments