■ ■ ■ ■ ■ ■
.github/workflows/build-docker-image.yml
| 1 | + | name: Build docker image and push to DockerHub |
| 2 | + | |
| 3 | + | on: |
| 4 | + | push: |
| 5 | + | tags: |
| 6 | + | - "v*.*.*" |
| 7 | + | |
| 8 | + | jobs: |
| 9 | + | docker: |
| 10 | + | runs-on: ubuntu-latest |
| 11 | + | steps: |
| 12 | + | - |
| 13 | + | name: Set up QEMU |
| 14 | + | uses: docker/setup-qemu-action@v1 |
| 15 | + | - |
| 16 | + | name: Set up Docker Buildx |
| 17 | + | uses: docker/setup-buildx-action@v1 |
| 18 | + | - |
| 19 | + | name: Login to DockerHub |
| 20 | + | uses: docker/login-action@v1 |
| 21 | + | with: |
| 22 | + | username: ${{ secrets.DOCKER_HUB_USERNAME }} |
| 23 | + | password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} |
| 24 | + | - |
| 25 | + | name: Build and push |
| 26 | + | id: docker_build |
| 27 | + | uses: docker/build-push-action@v2 |
| 28 | + | with: |
| 29 | + | push: true |
| 30 | + | tags: ${{ secrets.DOCKER_HUB_USERNAME }}/maigret:latest |
| 31 | + | - |
| 32 | + | name: Image digest |
| 33 | + | run: echo ${{ steps.docker_build.outputs.digest }} |
| 34 | + | |