Skip to content

Commit 96601c2

Browse files
authored
Merge pull request #92 from utilitywarehouse/dl-docker-build
Add image build and push action
2 parents 351fe16 + 8430383 commit 96601c2

File tree

2 files changed

+46
-1
lines changed

2 files changed

+46
-1
lines changed

.github/workflows/build.yaml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: build
2+
3+
on:
4+
push:
5+
branches:
6+
- "*"
7+
tags:
8+
- "v*"
9+
pull_request:
10+
branches:
11+
- "master"
12+
13+
env:
14+
REGISTRY: quay.io
15+
IMAGE_NAME: ${{ github.repository }}
16+
17+
jobs:
18+
docker:
19+
runs-on: ubuntu-latest
20+
if: github.actor != 'dependabot[bot]'
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
- name: Set up QEMU
25+
uses: docker/setup-qemu-action@v3
26+
- name: Set up Docker Buildx
27+
uses: docker/setup-buildx-action@v3
28+
- name: Extract metadata (tags, labels) for Docker
29+
id: meta
30+
uses: docker/metadata-action@v5
31+
with:
32+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
33+
- name: Login to Quay.io Container Registry
34+
uses: docker/login-action@v3
35+
with:
36+
registry: quay.io
37+
username: utilitywarehouse+drone_ci
38+
password: ${{ secrets.SYSTEM_QUAY_TOKEN }}
39+
- name: Build and push Docker image
40+
uses: docker/build-push-action@v6
41+
with:
42+
context: .
43+
push: true
44+
tags: ${{ steps.meta.outputs.tags }}
45+
labels: ${{ steps.meta.outputs.labels }}

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FROM golang:1.24-alpine AS build
22
WORKDIR /go/src/github.com/utilitywarehouse/gcp-disk-snapshotter
33
COPY . /go/src/github.com/utilitywarehouse/gcp-disk-snapshotter
4-
ENV CGO_ENABLED 0
4+
ENV CGO_ENABLED=0
55
RUN apk --no-cache add git &&\
66
go get -t ./... &&\
77
go test ./... &&\

0 commit comments

Comments
 (0)