Skip to content

Update tag generation #5

Update tag generation

Update tag generation #5

Workflow file for this run

name: docker build
on:
push:
branches:
- develop
- main
- feature/docker
jobs:
build:
runs-on: [self-hosted, linux]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Generate image tags
id: gen_tags
run: |
if [[ "$GITHUB_REF_NAME" == "develop" ]]; then
TAG='testing'
else
TAG='latest'
fi
if [[ $GITHUB_REF == 'refs/tags/'* ]]; then
TAG="${GITHUB_REF/refs\/tags\//}"
fi
echo $TAG
TAGS="nzbgetcom/nzbget:$TAG ghcr.io/nzbgetcom/nzbget:$TAG"
echo $TAGS
echo "tags=$TAGS" >> $GITHUB_OUTPUT
- name: Build and push
uses: docker/build-push-action@v5
with:
context: docker
platforms: linux/amd64
push: true
tags: ${{ steps.gen_tags.outputs.tags }}
build-args: |
"NZBGET_RELEASE=${GITHUB_REF_NAME}"
"MAKE_JOBS=2"