Skip to content

Commit 819cf61

Browse files
committed
gh-actions: Add container build
1 parent dfbf301 commit 819cf61

File tree

1 file changed

+49
-25
lines changed

1 file changed

+49
-25
lines changed

.github/workflows/go-build.yaml

Lines changed: 49 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,52 @@ jobs:
55
runs-on: ubuntu-latest
66

77
steps:
8-
- name: Checkout
9-
uses: actions/checkout@v3
10-
11-
- name: Build
12-
uses: actions/setup-go@v3
13-
with:
14-
go-version: '1.19'
15-
check-latest: true
16-
- run: |
17-
go build
18-
./infoscreen-operator --help
19-
mv infoscreen-operator iss-operator-amd64
20-
21-
- name: Create archive
22-
run: |
23-
xz iss-operator-amd64
24-
25-
- name: Release
26-
uses: "marvinpinto/action-automatic-releases@latest"
27-
with:
28-
repo_token: "${{ secrets.GITHUB_TOKEN }}"
29-
prerelease: false
30-
automatic_release_tag: "latest"
31-
files: |
32-
iss-operator-amd64.xz
8+
- name: Checkout
9+
uses: actions/checkout@v3
10+
11+
- name: Build
12+
uses: actions/setup-go@v3
13+
with:
14+
go-version: '1.19'
15+
check-latest: true
16+
- run: |
17+
go build
18+
./infoscreen-operator --help
19+
mv infoscreen-operator iss-operator-amd64
20+
21+
- name: Create archive
22+
run: |
23+
xz iss-operator-amd64
24+
25+
- name: Release
26+
uses: "marvinpinto/action-automatic-releases@latest"
27+
with:
28+
repo_token: "${{ secrets.GITHUB_TOKEN }}"
29+
prerelease: false
30+
automatic_release_tag: "latest"
31+
files: |
32+
iss-operator-amd64.xz
33+
34+
- name: Set up QEMU
35+
uses: docker/setup-qemu-action@v2
36+
37+
- name: Login to GitHub Container Registry
38+
uses: docker/login-action@v2
39+
with:
40+
registry: ghcr.io
41+
username: ${{ github.actor }}
42+
password: ${{ secrets.GITHUB_TOKEN }}
43+
44+
- name: Set up Docker Buildx
45+
uses: docker/setup-buildx-action@v2
46+
47+
- name: Build and push to ghcr
48+
id: docker_build
49+
uses: docker/build-push-action@v2
50+
with:
51+
platforms: linux/amd64
52+
push: true
53+
tags: ghcr.io/opsboost/iss-operator:latest
54+
55+
- name: Image digest
56+
run: echo ${{ steps.docker_build.outputs.digest }}

0 commit comments

Comments
 (0)