Build multi-arch docker images #25
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker Image CI | |
on: | |
push: | |
branches: [master] | |
tags: ['v*'] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Build the Docker image | |
run: docker build -t squid-exporter . | |
- name: Tag the Docker image latest | |
run: docker tag squid-exporter ${{ secrets.DOCKER_USERNAME }}/squid-exporter:latest | |
- name: Push the Docker image latest | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
push: true | |
tags: ${{ secrets.DOCKER_USERNAME }}/squid-exporter:latest | |
- name: Tag the Docker image version | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: docker tag squid-exporter ${{ secrets.DOCKER_USERNAME }}/squid-exporter:${{ github.ref_name }} | |
- name: Push the Docker image latest | |
if: startsWith(github.ref, 'refs/tags/v') | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
push: true | |
tags: ${{ secrets.DOCKER_USERNAME }}/squid-exporter:${{ github.ref_name }} |