This commit is contained in:
@@ -5,7 +5,7 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
tags:
|
tags:
|
||||||
- "v*" # trigger on tags starting with "v"
|
- "v*"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@@ -24,13 +24,23 @@ jobs:
|
|||||||
username: ${{ secrets.REGISTRY_USER }}
|
username: ${{ secrets.REGISTRY_USER }}
|
||||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
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
|
- name: Build and push image
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: ./Dockerfile
|
file: ./Dockerfile
|
||||||
push: true
|
push: true
|
||||||
tags: >-
|
tags: ${{ env.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) }}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user