Skip to content

Commit

Permalink
Refactoring GitHub actions
Browse files Browse the repository at this point in the history
Signed-off-by: Francesco Torchia <[email protected]>
  • Loading branch information
torchiaf committed May 23, 2024
1 parent 3593935 commit 40a47c3
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 40 deletions.
19 changes: 0 additions & 19 deletions .github/workflows/console-publish.yaml

This file was deleted.

7 changes: 5 additions & 2 deletions .github/workflows/docker-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
image-name:
required: true
type: string
tag-name:
required: true
type: string

env:
REGISTRY: ghcr.io
Expand All @@ -30,5 +33,5 @@ jobs:
- name: Build and push Docker image
working-directory: src/${{ inputs.image-name }}
run: |
docker build . --tag ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ github.event.repository.name }}/${{ inputs.image-name }}:latest
docker push ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ github.event.repository.name }}/${{ inputs.image-name }}:latest
docker build . --tag ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ github.event.repository.name }}/${{ inputs.image-name }}:${{ inputs.tag-name }}
docker push ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ github.event.repository.name }}/${{ inputs.image-name }}:${{ inputs.tag-name }}
25 changes: 25 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Publish

on:
push:
tags:
- v[0-9].*

jobs:
build-and-push-console:
uses: ./.github/workflows/docker-push.yaml
with:
image-name: console
tag-name: ${{ github.ref_name }}
permissions:
contents: read
packages: write

build-and-push-server:
uses: ./.github/workflows/docker-push.yaml
with:
image-name: server
tag-name: ${{ github.ref_name }}
permissions:
contents: read
packages: write
19 changes: 0 additions & 19 deletions .github/workflows/server-publish.yaml

This file was deleted.

0 comments on commit 40a47c3

Please sign in to comment.