Skip to content

Commit cf26b1c

Browse files
authored
DEVOPS-1626 - Add Github Action for container release (#1228)
1 parent 7f3f9c3 commit cf26b1c

File tree

2 files changed

+89
-0
lines changed

2 files changed

+89
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# ref: https://github.com/marketplace/actions/build-and-push-docker-images
2+
3+
name: Release container image
4+
5+
on:
6+
release:
7+
types: [published]
8+
9+
jobs:
10+
context:
11+
runs-on: ubuntu-latest
12+
13+
permissions:
14+
contents: read
15+
packages: write
16+
17+
steps:
18+
- name: Set up Docker Buildx
19+
uses: docker/setup-buildx-action@v2
20+
21+
- name: Log in to the Container registry
22+
uses: docker/login-action@v2
23+
with:
24+
registry: ghcr.io
25+
username: ${{ github.actor }}
26+
password: ${{ secrets.GITHUB_TOKEN }}
27+
28+
- name: Build and push
29+
uses: docker/build-push-action@v4
30+
with:
31+
github-token: ${{ secrets.GITHUB_TOKEN }}
32+
push: true
33+
34+
registry: ghcr.io
35+
organization: "${{ github.event.repository.owner.login }}"
36+
repository: "${{ github.event.repository.name }}"
37+
38+
platforms: |
39+
linux/amd64
40+
linux/arm64
41+
42+
tags: |
43+
latest
44+
${{ github.event.release.tag_name }}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# ref: https://docs.github.com/en/actions/publishing-packages/publishing-docker-images
2+
3+
name: Testing container image
4+
5+
on:
6+
push:
7+
branches:
8+
- 'develop'
9+
10+
jobs:
11+
context:
12+
runs-on: ubuntu-latest
13+
14+
permissions:
15+
contents: read
16+
packages: write
17+
18+
steps:
19+
- name: Set up Docker Buildx
20+
uses: docker/setup-buildx-action@v2
21+
22+
- name: Log in to the Container registry
23+
uses: docker/login-action@v2
24+
with:
25+
registry: ghcr.io
26+
username: ${{ github.actor }}
27+
password: ${{ secrets.GITHUB_TOKEN }}
28+
29+
- name: Build and push
30+
uses: docker/build-push-action@v4
31+
with:
32+
github-token: ${{ secrets.GITHUB_TOKEN }}
33+
push: true
34+
35+
registry: ghcr.io
36+
organization: "${{ github.event.repository.owner.login }}"
37+
repository: "${{ github.event.repository.name }}"
38+
39+
platforms: |
40+
linux/amd64
41+
linux/arm64
42+
43+
tags: |
44+
develop
45+
${{ github.sha }}

0 commit comments

Comments
 (0)