Skip to content

Commit d5b5a53

Browse files
authored
Merge pull request #10 from wandera/triv_add_docker_push_action
TRIVIAL: ADD GH action for docker build
2 parents 9e1a8b1 + cf404a7 commit d5b5a53

1 file changed

Lines changed: 46 additions & 0 deletions

File tree

.github/workflows/docker.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Docker release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
env:
9+
REGISTRY: ghcr.io
10+
IMAGE_NAME: wandera/jool
11+
TAG: ${{ github.ref_name }}
12+
13+
jobs:
14+
docker:
15+
name: Build
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v3
20+
- name: Set up Docker Buildx
21+
uses: docker/setup-buildx-action@v2
22+
- name: Setup Cosign
23+
uses: sigstore/cosign-installer@v3
24+
- name: Login to GitHub Container Registry
25+
uses: docker/login-action@v2
26+
with:
27+
registry: ${{ env.REGISTRY }}
28+
username: ${{ github.actor }}
29+
password: ${{ secrets.GITHUB_TOKEN }}
30+
- name: Setup image metadata
31+
id: docker_meta
32+
uses: docker/metadata-action@v4
33+
with:
34+
images: wandera/jool
35+
- name: Build and push
36+
uses: docker/build-push-action@v2
37+
with:
38+
context: .
39+
push: true
40+
tags: ${{ steps.docker_meta.outputs.tags }}
41+
labels: ${{ steps.docker_meta.outputs.labels }}
42+
- name: Sign the images
43+
env:
44+
DIGEST: ${{ steps.build.outputs.digest }}
45+
TAGS: ${{ steps.docker_meta.outputs.tags }}
46+
run: cosign sign --yes "${TAGS}@${DIGEST}"

0 commit comments

Comments
 (0)