Skip to content

Commit 40a47c3

Browse files
committed
Refactoring GitHub actions
Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
1 parent 3593935 commit 40a47c3

File tree

4 files changed

+30
-40
lines changed

4 files changed

+30
-40
lines changed

.github/workflows/console-publish.yaml

Lines changed: 0 additions & 19 deletions
This file was deleted.

.github/workflows/docker-push.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
image-name:
77
required: true
88
type: string
9+
tag-name:
10+
required: true
11+
type: string
912

1013
env:
1114
REGISTRY: ghcr.io
@@ -30,5 +33,5 @@ jobs:
3033
- name: Build and push Docker image
3134
working-directory: src/${{ inputs.image-name }}
3235
run: |
33-
docker build . --tag ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ github.event.repository.name }}/${{ inputs.image-name }}:latest
34-
docker push ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ github.event.repository.name }}/${{ inputs.image-name }}:latest
36+
docker build . --tag ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ github.event.repository.name }}/${{ inputs.image-name }}:${{ inputs.tag-name }}
37+
docker push ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ github.event.repository.name }}/${{ inputs.image-name }}:${{ inputs.tag-name }}

.github/workflows/publish.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Publish
2+
3+
on:
4+
push:
5+
tags:
6+
- v[0-9].*
7+
8+
jobs:
9+
build-and-push-console:
10+
uses: ./.github/workflows/docker-push.yaml
11+
with:
12+
image-name: console
13+
tag-name: ${{ github.ref_name }}
14+
permissions:
15+
contents: read
16+
packages: write
17+
18+
build-and-push-server:
19+
uses: ./.github/workflows/docker-push.yaml
20+
with:
21+
image-name: server
22+
tag-name: ${{ github.ref_name }}
23+
permissions:
24+
contents: read
25+
packages: write

.github/workflows/server-publish.yaml

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)