Don't override user preference in unrar #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: docker build | |
on: | |
push: | |
branches: | |
- develop | |
workflow_dispatch: | |
env: | |
REGISTRY_IMAGE: nzbgetcom/nzbget | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
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" | |
fi | |
if [[ "$GITHUB_REF_NAME" == "main" ]]; then | |
TAG="latest" | |
fi | |
if [[ $GITHUB_REF == 'refs/tags/'* ]]; then | |
TAG="${GITHUB_REF/refs\/tags\//}" | |
fi | |
if [[ "$TAG" == "" ]]; then | |
TAG="${GITHUB_REF_NAME/\//-}" | |
fi | |
if [[ "$GITHUB_REF_NAME" == "develop" ]] || [[ "$GITHUB_REF_NAME" == "main" ]] || [[ $GITHUB_REF == 'refs/tags/'* ]]; then | |
TAGS="${{ env.REGISTRY_IMAGE }}:$TAG,ghcr.io/${{ env.REGISTRY_IMAGE }}:$TAG" | |
else | |
TAGS="${{ env.REGISTRY_IMAGE }}:$TAG" | |
fi | |
echo "tags=$TAGS" >> $GITHUB_OUTPUT | |
echo "version=$TAG" >> $GITHUB_OUTPUT | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
context: docker | |
platforms: linux/amd64,linux/arm64,linux/arm/v7 | |
provenance: false | |
push: true | |
tags: ${{ steps.gen_tags.outputs.tags }} | |
outputs: "type=image,oci-mediatypes=false,name=${{ env.REGISTRY_IMAGE }}" | |
build-args: | | |
"NZBGET_RELEASE=${{ github.ref_name }}" | |
"MAKE_JOBS=2" | |
- name: Update Docker Hub Description | |
if: github.ref_name == 'main' | |
uses: peter-evans/dockerhub-description@v4 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
repository: ${{ env.REGISTRY_IMAGE }} | |
readme-filepath: ./docker/README.md | |
- name: Cleanup ghcr.io from outdated images | |
uses: miklinux/ghcr-cleanup-action@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
package-owner: nzbgetcom | |
package-name: nzbget | |
delete-orphans: true | |
dry-run: false |