|
7 | 7 | # Triggers the workflow on push or pull request events but only for the master branch |
8 | 8 | push: |
9 | 9 | branches: [ master ] |
10 | | - tags: [ '*' ] |
| 10 | + tags: [ "v*.*.*" ] |
11 | 11 | pull_request: |
12 | 12 | branches: [ master ] |
13 | | - |
| 13 | + release: |
| 14 | + types: ["created"] |
14 | 15 | # Allows you to run this workflow manually from the Actions tab |
15 | 16 | workflow_dispatch: |
| 17 | + inputs: {} |
16 | 18 |
|
17 | 19 | # A workflow run is made up of one or more jobs that can run sequentially or in parallelname: ci |
18 | 20 |
|
19 | 21 | jobs: |
20 | | - docker: |
21 | | - runs-on: ubuntu-latest |
| 22 | + build: |
| 23 | + runs-on: ubuntu-20.04 |
22 | 24 | steps: |
23 | | - - |
24 | | - name: Set up QEMU |
25 | | - uses: docker/setup-qemu-action@v1 |
26 | | - - |
27 | | - name: Set up Docker Buildx |
28 | | - uses: docker/setup-buildx-action@v1 |
29 | | - - |
30 | | - name: Docker meta |
31 | | - id: meta |
32 | | - uses: docker/metadata-action@v3 |
| 25 | + - uses: actions/checkout@v3 |
33 | 26 | with: |
34 | | - images: hyperflowwms/hyperflow |
35 | | - tags: | |
36 | | - type=semver,pattern={{raw}} |
37 | | - - |
38 | | - name: Login to DockerHub |
39 | | - uses: docker/login-action@v1 |
| 27 | + # Need tags for Makefile logic to work |
| 28 | + fetch-depth: 0 |
| 29 | + - name: Build the Docker images |
| 30 | + run: make images |
| 31 | + deploy: |
| 32 | + needs: [ "build" ] |
| 33 | + runs-on: ubuntu-20.04 |
| 34 | + if: github.event_name == 'release' && github.event.action == 'created' |
| 35 | + steps: |
| 36 | + - name: Login to Docker Hub |
| 37 | + uses: docker/login-action@v2 |
40 | 38 | with: |
41 | 39 | username: ${{ secrets.DOCKERHUB_USERNAME }} |
42 | 40 | password: ${{ secrets.DOCKERHUB_TOKEN }} |
43 | | - - |
44 | | - name: Build and push |
45 | | - id: docker_build |
46 | | - uses: docker/build-push-action@v2 |
| 41 | + - uses: actions/checkout@v2 |
47 | 42 | with: |
48 | | - push: true |
49 | | - tags: ${{ steps.meta.outputs.tags }} |
50 | | - labels: ${{ steps.meta.outputs.labels }} |
51 | | - - |
52 | | - name: Image digest |
53 | | - run: echo ${{ steps.docker_build.outputs.digest }} |
| 43 | + # Need tags for Makefile logic to work |
| 44 | + fetch-depth: 0 |
| 45 | + - name: Build and Push Docker Images |
| 46 | + run: make push |
0 commit comments