Docker #55
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 | |
on: | |
workflow_dispatch: | |
inputs: | |
golang: | |
description: GoLang Version | |
required: true | |
goreleaser: | |
description: GoReleaser Version | |
required: true | |
jobs: | |
# Push image to GitHub Packages. | |
# See also https://docs.docker.com/docker-hub/builds/ | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- | |
name: Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
username: arekkas | |
password: ${{ secrets.DOCKER_SECRET_AREKKAS }} | |
- name: Build and push image | |
run: | | |
export DOCKER_CLI_EXPERIMENTAL=enabled | |
docker buildx create --use | |
go_version="${{ github.event.inputs.golang }}" | |
goreleaser_version="${{ github.event.inputs.goreleaser }}" | |
docker buildx build --push \ | |
--build-arg GO_VERSION=${go_version} --build-arg GORELEASER_VERSION=${goreleaser_version} \ | |
--platform linux/amd64 \ | |
-t oryd/xgoreleaser:${go_version}-${goreleaser_version} \ | |
-t oryd/xgoreleaser:latest \ | |
. |