|
10 | 10 |
|
11 | 11 | jobs: |
12 | 12 | build: |
13 | | - runs-on: [self-hosted, web] |
14 | | - steps: |
15 | | - - uses: actions/checkout@v6 |
16 | | - - uses: actions/setup-python@v6 |
17 | | - with: |
18 | | - python-version: 3.9 |
19 | | - - name: Install Python dependencies |
20 | | - uses: py-actions/py-dependency-install@v4 |
21 | | - - name: Install Python libs |
22 | | - run: pip3 install -r ./requirements.txt |
23 | | - - uses: ruby/setup-ruby@v1 |
24 | | - with: |
25 | | - ruby-version: 3.2 |
26 | | - bundler-cache: true |
27 | | - - uses: seanmiddleditch/gha-setup-ninja@v6 |
28 | | - with: |
29 | | - version: 1.10.2 |
30 | | - - name: Install arm-none-eabi-gcc GNU Arm Embedded Toolchain |
31 | | - if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop' }} |
32 | | - uses: carlosperate/arm-none-eabi-gcc-action@v1.11.0 |
33 | | - - name: Install Doxygen |
34 | | - if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop' }} |
35 | | - run: | |
36 | | - wget https://www.doxygen.nl/files/doxygen-1.10.0.linux.bin.tar.gz |
37 | | - tar xf doxygen-1.10.0.linux.bin.tar.gz -C "$HOME" |
38 | | - echo "$HOME/doxygen-1.10.0/bin" >> $GITHUB_PATH |
39 | | - - name: Build Doxygen documentation |
40 | | - if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop' }} |
41 | | - run: make build_doxygen_adoc |
42 | | - - name: Build documentation |
43 | | - run: make -j 2 |
44 | | - - uses: actions/upload-artifact@v4 |
45 | | - if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop' }} |
46 | | - with: |
47 | | - name: documentation |
48 | | - path: documentation/html/ |
49 | | - if-no-files-found: error |
50 | | - retention-days: 1 |
51 | | - include-hidden-files: true |
| 13 | + uses: ./.github/workflows/build-and-deploy.yml |
| 14 | + if: ${{ github.ref != 'refs/heads/develop' && github.ref != 'refs/heads/master' }} |
| 15 | + with: |
| 16 | + deploy: false |
52 | 17 |
|
53 | | - deploy-staging: |
54 | | - needs: build |
55 | | - runs-on: ubuntu-latest |
56 | | - environment: |
57 | | - name: staging |
58 | | - url: ${{ vars.STAGING_URL }} |
| 18 | + staging-build: |
| 19 | + uses: ./.github/workflows/build-and-deploy.yml |
59 | 20 | if: ${{ github.ref == 'refs/heads/develop' }} |
60 | | - steps: |
61 | | - - uses: actions/checkout@v6 |
62 | | - - uses: actions/download-artifact@v5 |
63 | | - with: |
64 | | - name: documentation |
65 | | - path: documentation/html |
66 | | - - name: Deploy to Mythic Beasts |
67 | | - uses: ./.github/actions/deploy-action |
68 | | - with: |
69 | | - private_ssh_key: ${{ secrets.DEPLOY_SSH_KEY }} |
70 | | - public_bastion_host_keys: ${{ secrets.DEPLOY_KNOWN_HOSTS }} |
71 | | - bastion_host: ${{ secrets.DEPLOY_BASTION_HOST }} |
72 | | - primary_host: ${{ secrets.DEPLOY_PRIMARY_HOST }} |
73 | | - secondary_host: ${{ secrets.DEPLOY_SECONDARY_HOST }} |
74 | | - source: documentation/html/ |
75 | | - destination: documentation |
| 21 | + with: |
| 22 | + deploy: true |
| 23 | + environment: staging |
| 24 | + url: ${{ vars.STAGING_URL }} |
| 25 | + secrets: inherit |
76 | 26 |
|
77 | | - deploy-production: |
78 | | - needs: build |
79 | | - runs-on: ubuntu-latest |
80 | | - environment: |
81 | | - name: production |
82 | | - url: ${{ vars.PRODUCTION_URL }} |
| 27 | + production-build: |
| 28 | + uses: ./.github/workflows/build-and-deploy.yml |
83 | 29 | if: ${{ github.ref == 'refs/heads/master' }} |
84 | | - steps: |
85 | | - - uses: actions/checkout@v6 |
86 | | - - uses: actions/download-artifact@v5 |
87 | | - with: |
88 | | - name: documentation |
89 | | - path: documentation/html |
90 | | - - name: Deploy to Mythic Beasts |
91 | | - uses: ./.github/actions/deploy-action |
92 | | - with: |
93 | | - private_ssh_key: ${{ secrets.DEPLOY_SSH_KEY }} |
94 | | - public_bastion_host_keys: ${{ secrets.DEPLOY_KNOWN_HOSTS }} |
95 | | - bastion_host: ${{ secrets.DEPLOY_BASTION_HOST }} |
96 | | - primary_host: ${{ secrets.DEPLOY_PRIMARY_HOST }} |
97 | | - secondary_host: ${{ secrets.DEPLOY_SECONDARY_HOST }} |
98 | | - source: documentation/html/ |
99 | | - destination: documentation |
| 30 | + with: |
| 31 | + deploy: true |
| 32 | + environment: production |
| 33 | + url: ${{ vars.PRODUCTION_URL }} |
| 34 | + secrets: inherit |
0 commit comments