|
10 | 10 | options: |
11 | 11 | - dapp-dev |
12 | 12 | - dapp-prod |
13 | | - image-tag: |
14 | | - description: 'Tag for the dapp image to sconify' |
15 | | - required: true |
16 | | - type: string |
17 | | - default: 'latest' |
18 | 13 | sconify-version: |
19 | 14 | description: 'Version of the sconify image to use' |
20 | 15 | type: string |
|
24 | 19 | DEPLOY_ENVIRONMENT: ${{ inputs.environment }} |
25 | 20 |
|
26 | 21 | jobs: |
| 22 | + build-and-push: |
| 23 | + runs-on: ubuntu-latest |
| 24 | + outputs: |
| 25 | + image-name: ${{ steps.build.outputs.image-name }} |
| 26 | + image-tag: ${{ steps.build.outputs.image-tag }} |
| 27 | + steps: |
| 28 | + - name: Checkout code |
| 29 | + uses: actions/checkout@v4 |
| 30 | + |
| 31 | + - name: Set up Docker Buildx |
| 32 | + uses: docker/setup-buildx-action@v3 |
| 33 | + |
| 34 | + - name: Login to DockerHub |
| 35 | + uses: docker/login-action@v3 |
| 36 | + with: |
| 37 | + username: ${{ secrets.DOCKERHUB_USERNAME }} |
| 38 | + password: ${{ secrets.DOCKERHUB_PAT }} |
| 39 | + |
| 40 | + - name: Get dapp version |
| 41 | + id: version |
| 42 | + run: | |
| 43 | + VERSION=$(node -p "require('./dapp/package.json').version") |
| 44 | + echo "version=$VERSION" >> $GITHUB_OUTPUT |
| 45 | + echo "dapp-version=$VERSION" |
| 46 | +
|
| 47 | + - name: Build and push Docker image |
| 48 | + id: build |
| 49 | + uses: docker/build-push-action@v5 |
| 50 | + with: |
| 51 | + context: ./dapp |
| 52 | + push: true |
| 53 | + tags: ${{ secrets.DOCKERHUB_USERNAME }}/product/web3telegram-dapp:${{ steps.version.outputs.version }}-non-tee |
| 54 | + cache-from: type=gha |
| 55 | + cache-to: type=gha,mode=max |
| 56 | + outputs: |
| 57 | + image-name: ${{ secrets.DOCKERHUB_USERNAME }}/product/web3telegram-dapp |
| 58 | + image-tag: ${{ steps.version.outputs.version }}-non-tee |
| 59 | + |
27 | 60 | sconify: |
| 61 | + needs: build-and-push |
28 | 62 | uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/sconify.yml@sconify-v2 |
29 | 63 | with: |
30 | | - image-name: product/web3telegram-dapp |
31 | | - image-tag: ${{ inputs.image-tag }} |
| 64 | + image-name: ${{ needs.build-and-push.outputs.image-name }} |
| 65 | + image-tag: ${{ needs.build-and-push.outputs.image-tag }} |
32 | 66 | sconify-debug: false |
33 | 67 | sconify-prod: true |
34 | 68 | docker-registry: docker.io |
|
70 | 104 |
|
71 | 105 | deploy-dapp: |
72 | 106 | runs-on: ubuntu-latest |
73 | | - needs: sconify |
| 107 | + needs: [build-and-push, sconify] |
74 | 108 | steps: |
75 | 109 | - name: Checkout code |
76 | 110 | uses: actions/checkout@v4 |
|
0 commit comments