Skip to content

Commit b3b3189

Browse files
authored
Merge pull request #342 from YaSuenag/release-workflow
LGTM - we may create a sub workflow for the image generation in the future Add 4-release.yaml to publish container image for the release
2 parents d3ca5b1 + 314ed12 commit b3b3189

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

.github/workflows/4-release.yaml

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Publish container image to GitHub Packages
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
env:
8+
REGISTRY: ghcr.io
9+
IMAGE_NAME: ${{ github.repository }}
10+
11+
jobs:
12+
publish-container-image:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
packages: write
16+
steps:
17+
- name: Set up QEMU
18+
uses: docker/setup-qemu-action@v2
19+
- name: Set up Docker Buildx
20+
uses: docker/setup-buildx-action@v2
21+
- name: Log in to the Container registry
22+
uses: docker/[email protected]
23+
with:
24+
registry: ${{ env.REGISTRY }}
25+
username: ${{ github.actor }}
26+
password: ${{ github.token }}
27+
- name: Extract metadata (tags, labels) for Docker
28+
id: meta
29+
uses: docker/[email protected]
30+
with:
31+
flavor: latest=true
32+
tags: type=raw,value=${{ github.ref_name }}
33+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
34+
- name: Build and push Docker image
35+
uses: docker/[email protected]
36+
with:
37+
context: "{{defaultContext}}:src"
38+
file: CarbonAware.WebApi/src/Dockerfile
39+
platforms: linux/amd64,linux/arm64
40+
push: true
41+
tags: ${{ steps.meta.outputs.tags }}
42+
labels: ${{ steps.meta.outputs.labels }}
43+
provenance: false

0 commit comments

Comments
 (0)