updated tagging on build actions
This commit is contained in:
@@ -27,4 +27,51 @@ jobs:
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: blinkfink182/qbt-gluetun-portmgr:test
|
||||
tags: blinkfink182/qbt-gluetun-portmgr:test
|
||||
|
||||
|
||||
name: Build and Push Docker Image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "**"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Compute image tag
|
||||
id: tag
|
||||
run: |
|
||||
BRANCH="${{ gitea.ref_name }}"
|
||||
|
||||
if [ "$BRANCH" = "main" ]; then
|
||||
TAG="latest"
|
||||
elif [[ "$BRANCH" == v* ]]; then
|
||||
TAG="$BRANCH"
|
||||
else
|
||||
TAG="test"
|
||||
fi
|
||||
|
||||
echo "tag=$TAG" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: blinkfink182/qbt-gluetun-portmgr:${{ steps.tag.outputs.tag }}
|
||||
Reference in New Issue
Block a user