Skip to content

Commit 0256ae2

Browse files
committed
Add docker build workflow
1 parent 7e8e728 commit 0256ae2

File tree

2 files changed

+43
-1
lines changed

2 files changed

+43
-1
lines changed

.github/workflows/tag.yaml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: "Release a tag"
2+
on:
3+
push:
4+
tags:
5+
- '*'
6+
7+
jobs:
8+
docker-release:
9+
runs-on: ubuntu-22.04
10+
steps:
11+
- uses: actions/checkout@v3
12+
- name: Set up QEMU
13+
uses: docker/setup-qemu-action@v2
14+
- name: Set up Docker Buildx
15+
uses: docker/setup-buildx-action@v2
16+
- name: Login to docker.io
17+
run: docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_PASSWORD }}
18+
- name: Build and publish
19+
uses: docker/build-push-action@v4
20+
with:
21+
context: .
22+
file: build/protty/Dockerfile
23+
platforms: linux/amd64,linux/arm64
24+
push: true
25+
tags: mgerasimchuk/protty:${{ github.ref_name }}
26+
- name: Docker Hub Description
27+
uses: peter-evans/dockerhub-description@v3
28+
with:
29+
username: ${{ secrets.DOCKERHUB_USERNAME }}
30+
password: ${{ secrets.DOCKERHUB_PASSWORD }}
31+
repository: mgerasimchuk/protty
32+
docker-publish-readme:
33+
runs-on: ubuntu-22.04
34+
needs: docker-release
35+
steps:
36+
- uses: actions/checkout@v3
37+
- name: Docker Hub Description
38+
uses: peter-evans/dockerhub-description@v3
39+
with:
40+
username: ${{ secrets.DOCKERHUB_USERNAME }}
41+
password: ${{ secrets.DOCKERHUB_PASSWORD }}
42+
repository: mgerasimchuk/protty

build/protty/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ FROM golang:1.18.9-alpine3.17 as builder
33
WORKDIR /app
44
COPY . .
55

6-
RUN GOSUMDB=off CGO_ENABLED=0 GOOS=linux go build -mod=vendor -a -o bin/protty cmd/protty/main.go
6+
RUN CGO_ENABLED=0 GOOS=linux go build -a -o bin/protty cmd/protty/main.go
77

88
FROM alpine:3.17.0
99

0 commit comments

Comments
 (0)