This commit is contained in:
@@ -5,7 +5,7 @@ on:
|
||||
branches:
|
||||
- main
|
||||
tags:
|
||||
- "v*" # trigger on tags starting with "v"
|
||||
- "v*"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -24,13 +24,23 @@ jobs:
|
||||
username: ${{ secrets.REGISTRY_USER }}
|
||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||
|
||||
- name: Set Docker tags
|
||||
id: docker-tags
|
||||
run: |
|
||||
TAGS="calahilstudios/${{ github.repository_owner }}/${{ github.event.repository.name }}:latest"
|
||||
TAGS="$TAGS calahilstudios/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ github.sha }}"
|
||||
|
||||
# Only add tag if this is a v* tag push
|
||||
if [[ "${GITHUB_REF}" == refs/tags/v* ]]; then
|
||||
TAGS="$TAGS calahilstudios/${{ github.repository_owner }}/${{ github.event.repository.name }}:${GITHUB_REF#refs/tags/}"
|
||||
fi
|
||||
|
||||
echo "TAGS=$TAGS" >> $GITHUB_ENV
|
||||
|
||||
- name: Build and push image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
push: true
|
||||
tags: >-
|
||||
calahilstudios/${{ github.repository_owner }}/${{ github.event.repository.name }}:latest
|
||||
calahilstudios/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ github.sha }}
|
||||
${{ github.ref_type == 'tag' && startsWith(github.ref_name, 'v') && format('calahilstudios/{0}/{1}:{2}', github.repository_owner, github.event.repository.name, github.ref_name) }}
|
||||
tags: ${{ env.TAGS }}
|
||||
|
||||
Reference in New Issue
Block a user