-
Notifications
You must be signed in to change notification settings - Fork 8
40 lines (35 loc) · 1.11 KB
/
docker-publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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 \
.