|
1 | 1 | ---
|
2 | 2 | name: deploy-website
|
3 | 3 | on:
|
4 |
| - release: |
5 |
| - types: [published] |
| 4 | + release: |
| 5 | + types: [published] |
6 | 6 | permissions:
|
7 |
| - contents: write |
8 |
| - pages: write # to deploy to Pages |
9 |
| - id-token: write # to verify the deployment originates from an appropriate source |
| 7 | + contents: write |
| 8 | + pages: write # to deploy to Pages |
| 9 | + id-token: write # to verify the deployment originates from an appropriate source |
10 | 10 | # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
|
11 | 11 | # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
|
12 | 12 | concurrency:
|
13 |
| - group: pages |
14 |
| - cancel-in-progress: false |
| 13 | + group: pages |
| 14 | + cancel-in-progress: false |
15 | 15 | jobs:
|
16 |
| - pre-commit-check: |
17 |
| - runs-on: ubuntu-latest |
18 |
| - container: |
19 |
| - image: ghcr.io/pythonbiellagroup/dockbase/python-base:${{vars.BASE_DOCKER_VERSION}} |
20 |
| - credentials: |
21 |
| - username: ${{ github.actor }} |
22 |
| - password: ${{ secrets.GITHUB_TOKEN }} |
23 |
| - steps: |
24 |
| - - name: Checkout code |
25 |
| - uses: actions/checkout@v2 |
26 |
| - - name: Configure safe github directory |
27 |
| - shell: bash |
28 |
| - run: git config --global --add safe.directory /__w/website/website |
29 |
| - - name: Install pre-commit check |
30 |
| - shell: bash |
31 |
| - run: poetry install --only dev --sync |
32 |
| - - name: Run pre-commit check |
33 |
| - shell: bash |
34 |
| - run: poetry run pre-commit run -a |
35 |
| - deploy: |
36 |
| - needs: pre-commit-check |
37 |
| - runs-on: ubuntu-latest |
38 |
| - if: success() |
39 |
| - environment: |
40 |
| - name: github-pages |
41 |
| - url: ${{ steps.deployment.outputs.page_url }} |
42 |
| - container: |
43 |
| - image: ghcr.io/pythonbiellagroup/dockbase/python-base:${{vars.BASE_DOCKER_VERSION}} |
44 |
| - credentials: |
45 |
| - username: ${{ github.actor }} |
46 |
| - password: ${{ secrets.GITHUB_TOKEN }} |
47 |
| - steps: |
48 |
| - - name: Checkout |
49 |
| - uses: actions/checkout@v3 |
50 |
| - - name: Configure safe github directory |
51 |
| - shell: bash |
52 |
| - run: git config --global --add safe.directory /__w/website/website |
53 |
| - - name: Add mkdocs-material credentials |
54 |
| - shell: bash |
55 |
| - run: poetry config http-basic.mkdocs ${{secrets.GHCR_USERNAME}} ${{secrets.GHCR_TOKEN}} |
56 |
| - - name: Install packages |
57 |
| - shell: bash |
58 |
| - run: poetry install |
59 |
| - - name: Build mkdocs website inside docker |
60 |
| - shell: bash |
61 |
| - run: make docs_build |
62 |
| - env: |
63 |
| - GOOGLE_ANALYTICS_KEY: ${{ secrets.GOOGLE_ANALYTICS_KEY }} |
64 |
| - - name: Setup Pages |
65 |
| - uses: actions/configure-pages@v3 |
66 |
| - - name: Upload artifact |
67 |
| - uses: actions/upload-pages-artifact@v2 |
68 |
| - with: |
| 16 | + pre-commit-check: |
| 17 | + runs-on: ubuntu-latest |
| 18 | + container: |
| 19 | + image: ghcr.io/pythonbiellagroup/dockbase/python-base:${{vars.BASE_DOCKER_VERSION}} |
| 20 | + credentials: |
| 21 | + username: ${{ github.actor }} |
| 22 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 23 | + steps: |
| 24 | + - name: Checkout code |
| 25 | + uses: actions/checkout@v2 |
| 26 | + - name: Configure safe github directory |
| 27 | + shell: bash |
| 28 | + run: git config --global --add safe.directory /__w/website/website |
| 29 | + - name: Install pre-commit check |
| 30 | + shell: bash |
| 31 | + run: poetry install --only dev --sync |
| 32 | + - name: Run pre-commit check |
| 33 | + shell: bash |
| 34 | + run: poetry run pre-commit run -a |
| 35 | + deploy: |
| 36 | + needs: pre-commit-check |
| 37 | + runs-on: ubuntu-latest |
| 38 | + if: success() |
| 39 | + environment: |
| 40 | + name: github-pages |
| 41 | + url: ${{ steps.deployment.outputs.page_url }} |
| 42 | + container: |
| 43 | + image: ghcr.io/pythonbiellagroup/dockbase/python-base:${{vars.BASE_DOCKER_VERSION}} |
| 44 | + credentials: |
| 45 | + username: ${{ github.actor }} |
| 46 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 47 | + steps: |
| 48 | + - name: Checkout |
| 49 | + uses: actions/checkout@v3 |
| 50 | + - name: Configure safe github directory |
| 51 | + shell: bash |
| 52 | + run: git config --global --add safe.directory /__w/website/website |
| 53 | + - name: Add mkdocs-material credentials |
| 54 | + shell: bash |
| 55 | + run: poetry config http-basic.mkdocs ${{secrets.GHCR_USERNAME}} ${{secrets.GHCR_TOKEN}} |
| 56 | + - name: Install packages |
| 57 | + shell: bash |
| 58 | + run: poetry install |
| 59 | + - name: Build mkdocs website inside docker |
| 60 | + shell: bash |
| 61 | + run: make docs_build |
| 62 | + env: |
| 63 | + GOOGLE_ANALYTICS_KEY: ${{ secrets.GOOGLE_ANALYTICS_KEY }} |
| 64 | + - name: Setup Pages |
| 65 | + uses: actions/configure-pages@v3 |
| 66 | + - name: Upload artifact |
| 67 | + uses: actions/upload-pages-artifact@v2 |
| 68 | + with: |
69 | 69 | # Upload entire repository
|
70 |
| - path: ./site |
71 |
| - - name: Deploy to GitHub Pages |
72 |
| - id: deployment |
73 |
| - uses: actions/deploy-pages@v2 |
| 70 | + path: ./site |
| 71 | + - name: Deploy to GitHub Pages |
| 72 | + id: deployment |
| 73 | + uses: actions/deploy-pages@v2 |
0 commit comments