Push the VERSION tag, too #7
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
# github action to Build and publish Docker image | |
name: Docker | |
on: | |
push: | |
branches: [ master ] | |
jobs: | |
build: | |
name: Build | |
environment: besticon-docker | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Go 1.x | |
uses: actions/setup-go@v4 | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v2 | |
- name: Build | |
run: go get github.com/mat/besticon/... | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ vars.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Read VERSION | |
id: version | |
run: echo "VERSION=$(cat VERSION)" >> $GITHUB_ENV | |
- name: Build and Push Multi-Platform Docker image | |
run: | | |
docker buildx build \ | |
--platform linux/amd64,linux/arm64 \ | |
-t matthiasluedtke/iconserver:latest \ | |
-t matthiasluedtke/iconserver:${{ env.VERSION }} \ | |
--push . |