|
1 | | -name: Deploy production |
2 | | - |
3 | | -on: |
4 | | - push: |
5 | | - tags: |
6 | | - - 'v*' |
7 | | - |
8 | | -jobs: |
9 | | - deploy: |
10 | | - name: Deploy pages |
11 | | - runs-on: ubuntu-latest |
12 | | - steps: |
13 | | - - name: Fetch latest code |
14 | | - uses: actions/checkout@v4 |
15 | | - - name: Setup Python |
16 | | - uses: actions/setup-python@v5 |
17 | | - with: |
18 | | - python-version: "3.12" |
19 | | - - name: Build pages |
20 | | - run: | |
21 | | - pip3 install poetry |
22 | | - poetry run poetry install --no-root |
23 | | - poetry run mkdocs build |
24 | | - - name: Setup Vercel environment |
25 | | - uses: actions/checkout@v4 |
26 | | - with: |
27 | | - repository: darwinia-network/devops |
28 | | - path: .github |
29 | | - - name: Deploy to Vercel |
30 | | - uses: ./.github/actions/smart-vercel |
31 | | - with: |
32 | | - vercel_token: ${{ secrets.VERCEL_TOKEN }} |
33 | | - vercel_group: itering |
34 | | - preview_output: true |
35 | | - project_name: darwinia-docs |
36 | | - dist_path: site |
37 | | - prod_mode: true |
38 | | - script_run: false |
39 | | - enable_cache: true |
40 | | - enable_notify_slack: true |
41 | | - slack_channel: darwinia-document |
42 | | - slack_webhook: ${{ secrets.SLACK_INCOMING_WEBHOOK_URL }} |
| 1 | +name: Deploy production with GitHub Pages |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - "v*" |
| 7 | + |
| 8 | +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages |
| 9 | +permissions: |
| 10 | + contents: read |
| 11 | + pages: write |
| 12 | + id-token: write |
| 13 | + |
| 14 | +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. |
| 15 | +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. |
| 16 | +concurrency: |
| 17 | + group: "pages" |
| 18 | + cancel-in-progress: false |
| 19 | + |
| 20 | +jobs: |
| 21 | + deploy: |
| 22 | + environment: |
| 23 | + name: github-pages |
| 24 | + url: ${{ steps.deployment.outputs.page_url }} |
| 25 | + runs-on: ubuntu-latest |
| 26 | + steps: |
| 27 | + - name: Fetch latest code |
| 28 | + uses: actions/checkout@v4 |
| 29 | + with: |
| 30 | + fetch-depth: 0 |
| 31 | + - name: Setup Python |
| 32 | + uses: actions/setup-python@v5 |
| 33 | + with: |
| 34 | + python-version: "3.12" |
| 35 | + - name: Build pages |
| 36 | + run: | |
| 37 | + pip3 install poetry |
| 38 | + poetry run poetry install --no-root |
| 39 | + poetry run mkdocs build |
| 40 | + - name: Setup Pages |
| 41 | + uses: actions/configure-pages@v4 |
| 42 | + - name: Upload artifact |
| 43 | + uses: actions/upload-pages-artifact@v3 |
| 44 | + with: |
| 45 | + path: "site" |
| 46 | + - name: Deploy to GitHub Pages |
| 47 | + id: deployment |
| 48 | + uses: actions/deploy-pages@v4 |
0 commit comments