Skip to content

Commit d7b347a

Browse files
committed
github action to publish images to ghcr
Signed-off-by: Anton Mitsengendler <anton.mitsengendler@outlook.com>
1 parent 2374739 commit d7b347a

File tree

1 file changed

+27
-10
lines changed

1 file changed

+27
-10
lines changed

.github/workflows/docker-image.yml

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,35 @@ on:
55
branches: [ "master" ]
66

77
jobs:
8-
98
build:
10-
119
runs-on: ubuntu-latest
12-
10+
permissions:
11+
packages: write
1312
steps:
14-
- uses: actions/checkout@v4
13+
- name: Set image postfix
14+
run: echo "DOCKER_IMAGE_POSTFIX=$(date +%Y-%m-%d_%s)" >> "$GITHUB_ENV"
15+
- name: Checkout the repo
16+
uses: actions/checkout@v4
17+
18+
- name: Log in to the Container registry
19+
uses: docker/login-action@v3
20+
with:
21+
registry: https://ghcr.io
22+
username: ${{ github.actor }}
23+
password: ${{ secrets.GITHUB_TOKEN }}
1524

16-
- name: Build Server Docker Image
17-
working-directory: src
18-
run: docker build . --file PodLoad.Server/Dockerfile --tag podload-server:$(date +%s)
25+
- name: Build and push server image
26+
uses: docker/build-push-action@v6
27+
with:
28+
context: src
29+
file: PodLoad.Server/Dockerfile
30+
push: true
31+
tags: ghcr.io/rumkit/pod-load-simulator:server-${{ env.DOCKER_IMAGE_POSTFIX }}
1932

20-
- name: Build Client Docker Image
21-
working-directory: src
22-
run: docker build . --file PodLoad.Client/Dockerfile --tag podload-client:$(date +%s)
33+
- name: Build and push client image
34+
uses: docker/build-push-action@v6
35+
with:
36+
context: src
37+
file: PodLoad.Client/Dockerfile
38+
push: true
39+
tags: ghcr.io/rumkit/pod-load-simulator:client-${{ env.DOCKER_IMAGE_POSTFIX }}

0 commit comments

Comments
 (0)