Skip to content

Commit 7575300

Browse files
committed
ci: publish docker images to github
1 parent 3d5b1ca commit 7575300

File tree

2 files changed

+40
-8
lines changed

2 files changed

+40
-8
lines changed

.github/workflows/docker.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Publish Docker image
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
release:
9+
types: [published]
10+
11+
jobs:
12+
push_to_registries:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
packages: write
16+
contents: read
17+
steps:
18+
- name: Check out the repo
19+
uses: actions/checkout@v2
20+
21+
- name: Log in to the Container registry
22+
uses: docker/login-action@v1.10.0
23+
with:
24+
registry: ghcr.io
25+
username: ${{ github.actor }}
26+
password: ${{ secrets.GITHUB_TOKEN }}
27+
28+
- name: Extract metadata (tags, labels) for Docker
29+
id: meta
30+
uses: docker/metadata-action@v3.5.0
31+
with:
32+
images: ghcr.io/${{ github.repository }}
33+
34+
- name: Build and push Docker images
35+
uses: docker/build-push-action@v2.7.0
36+
with:
37+
context: .
38+
push: true
39+
tags: ${{ steps.meta.outputs.tags }}
40+
labels: ${{ steps.meta.outputs.labels }}

.github/workflows/go.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,3 @@ jobs:
2323

2424
- name: Test
2525
run: go test -v ./...
26-
27-
docker:
28-
runs-on: ubuntu-latest
29-
steps:
30-
- uses: actions/checkout@v2
31-
32-
- name: Build
33-
run: docker build .

0 commit comments

Comments
 (0)