|
1 | 1 | name: Docker Image & deploy |
2 | 2 |
|
| 3 | +# Build & publish the Docker image and trigger the Render deploy whenever main |
| 4 | +# changes. (Previously chained to the release-please workflow via workflow_run; |
| 5 | +# that release workflow has been removed.) |
3 | 6 | on: |
4 | | - workflow_run: |
5 | | - workflows: [release-please] |
6 | | - types: [completed] |
| 7 | + push: |
| 8 | + branches: [main] |
| 9 | + workflow_dispatch: |
7 | 10 |
|
8 | 11 | jobs: |
9 | 12 | build-and-publish: |
10 | 13 | runs-on: ubuntu-latest |
11 | | - if: github.event.workflow_run.conclusion == 'success' |
12 | 14 |
|
13 | 15 | steps: |
14 | 16 | - name: Checkout the code |
15 | | - uses: actions/checkout@v3 |
16 | | - |
17 | | - - name: Build the Docker image |
18 | | - run: docker build . --file Dockerfile --tag frabenrui/flamapy-ide:${{ github.ref_name }} |
| 17 | + uses: actions/checkout@v4 |
19 | 18 |
|
20 | 19 | - name: Log in to DockerHub |
21 | 20 | uses: docker/login-action@v3 |
22 | 21 | with: |
23 | 22 | username: ${{ secrets.DOCKERHUB_USERNAME }} |
24 | 23 | password: ${{ secrets.DOCKERHUB_API_TOKEN }} |
25 | 24 |
|
26 | | - - name: Push the Docker image |
27 | | - run: docker push frabenrui/flamapy-ide:${{ github.ref_name }} |
| 25 | + - name: Build the Docker image |
| 26 | + run: docker build . --file Dockerfile --tag frabenrui/flamapy-ide:latest |
28 | 27 |
|
29 | | - - name: Tag as latest |
30 | | - if: startsWith(github.ref, 'refs/tags/') |
31 | | - run: | |
32 | | - docker tag frabenrui/flamapy-ide:${{ github.ref_name }} frabenrui/flamapy-ide:latest |
33 | | - docker push frabenrui/flamapy-ide:latest |
| 28 | + - name: Push the Docker image |
| 29 | + run: docker push frabenrui/flamapy-ide:latest |
34 | 30 |
|
35 | 31 | deploy: |
| 32 | + needs: build-and-publish |
36 | 33 | runs-on: ubuntu-latest |
37 | | - if: github.event.workflow_run.conclusion == 'success' |
38 | 34 |
|
39 | 35 | steps: |
40 | 36 | - name: Deploy |
41 | 37 | env: |
42 | | - deploy_url: ${{secrets.RENDER_DEPLOY_HOOK_URL}} |
| 38 | + deploy_url: ${{ secrets.RENDER_DEPLOY_HOOK_URL }} |
43 | 39 | run: | |
44 | 40 | curl "$deploy_url" |
0 commit comments