|
4 | 4 | types: [published] |
5 | 5 |
|
6 | 6 | jobs: |
7 | | - build: |
8 | | - name: Build |
| 7 | + determine_whether_to_run: |
| 8 | + runs-on: ubuntu-latest |
| 9 | + outputs: |
| 10 | + build_arc: ${{ steps.check-build-arc.outputs.run_jobs }} |
| 11 | + build_sls: ${{ steps.check-build-sls.outputs.run_jobs }} |
| 12 | + |
| 13 | + steps: |
| 14 | + - name: Check if Arc binary should be built |
| 15 | + id: check-build-arc |
| 16 | + run: (echo "${{ github.ref }}" | grep -Eq '^refs\/tags\/8\.[0-9]+\.[0-9]+$') && echo "run_jobs=true" >> $GITHUB_OUTPUT || echo "run_jobs==false" >> $GITHUB_OUTPUT |
| 17 | + |
| 18 | + - name: Check if SLS binary should be built |
| 19 | + id: check-build-sls |
| 20 | + run: (echo "${{ github.ref }}" | grep -Eq '^refs\/tags\/1\.[0-9]+\.[0-9]+$') && echo "run_jobs=true" >> $GITHUB_OUTPUT || echo "run_jobs==false" >> $GITHUB_OUTPUT |
| 21 | + |
| 22 | + build-arc: |
| 23 | + name: Build ARC binary |
| 24 | + needs: determine_whether_to_run |
| 25 | + if: needs.determine_whether_to_run.outputs.build_arc == 'true' |
9 | 26 | runs-on: ubuntu-latest |
10 | 27 | timeout-minutes: 60 |
11 | 28 | steps: |
@@ -48,11 +65,46 @@ jobs: |
48 | 65 | script: | |
49 | 66 | sh build.sh ${VERSION} |
50 | 67 |
|
51 | | - send-packer-event: |
| 68 | + build-sls: |
| 69 | + name: Build SLS binary |
| 70 | + needs: determine_whether_to_run |
| 71 | + if: needs.determine_whether_to_run.outputs.build_sls == 'true' |
| 72 | + runs-on: ubuntu-latest |
| 73 | + timeout-minutes: 60 |
| 74 | + steps: |
| 75 | + - name: Checkout Repository |
| 76 | + uses: actions/checkout@v2 |
| 77 | + - name: building binaries for eaas deployments |
| 78 | + uses: appleboy/ssh-action@master |
| 79 | + env: |
| 80 | + VERSION: ${{ github.event.release.tag_name }} |
| 81 | + with: |
| 82 | + host: ${{ secrets.GCLOUD_BUILD_HOST }} |
| 83 | + username: ${{ secrets.GCLOUD_BUILD_USERNAME }} |
| 84 | + key: ${{ secrets.GCLOUD_BUILD_KEY }} |
| 85 | + port: 22 |
| 86 | + timeout: 3600s |
| 87 | + command_timeout: 3600s |
| 88 | + envs: VERSION |
| 89 | + script: | |
| 90 | + sh sls-build.sh ${VERSION} feat/true-sls |
| 91 | +
|
| 92 | + send-packer-event-arc: |
| 93 | + name: Send Packer Event |
| 94 | + needs: build-arc |
| 95 | + uses: ./.github/workflows/build_images.yml |
| 96 | + with: |
| 97 | + ref: ${{ github.ref }} |
| 98 | + event_name: new_release |
| 99 | + secrets: |
| 100 | + token: ${{ secrets.REPO_ACCESS_TOKEN }} |
| 101 | + |
| 102 | + send-packer-event-sls: |
52 | 103 | name: Send Packer Event |
53 | | - needs: build |
| 104 | + needs: build-sls |
54 | 105 | uses: ./.github/workflows/build_images.yml |
55 | 106 | with: |
56 | 107 | ref: ${{ github.ref }} |
| 108 | + event_name: new_sls_release |
57 | 109 | secrets: |
58 | 110 | token: ${{ secrets.REPO_ACCESS_TOKEN }} |
0 commit comments