mirror of
https://github.com/BrenBroZAYT/gameyfin.git
synced 2026-06-17 00:30:04 +00:00
Add bugfix Docker image workflow
This commit is contained in:
@@ -0,0 +1,34 @@
|
|||||||
|
name: Delete Docker Tag on Merge
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
delete-docker-tag:
|
||||||
|
if: |
|
||||||
|
contains(github.event.head_commit.message, 'Merge pull request') &&
|
||||||
|
startsWith(github.event.head_commit.message, 'Merge pull request')
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Extract merged branch name
|
||||||
|
id: extract_branch
|
||||||
|
run: |
|
||||||
|
# Extract branch name from merge commit message
|
||||||
|
BRANCH=$(echo "${{ github.event.head_commit.message }}" | grep -oE 'fix/[^ ]+')
|
||||||
|
TAG=${BRANCH#fix/}
|
||||||
|
echo "tag=$TAG" >> $GITHUB_OUTPUT
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- name: Delete Docker tag from Docker Hub
|
||||||
|
if: steps.extract_branch.outputs.tag != ''
|
||||||
|
env:
|
||||||
|
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
TAG: ${{ steps.extract_branch.outputs.tag }}
|
||||||
|
run: |
|
||||||
|
echo "Deleting Docker tag: $TAG"
|
||||||
|
curl -X DELETE -u "$DOCKERHUB_USERNAME:$DOCKERHUB_TOKEN" \
|
||||||
|
"https://hub.docker.com/v2/repositories/grimsi/gameyfin/tags/$TAG/"
|
||||||
|
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
name: Build and Push Docker Image (fix/*)
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- 'fix/*'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-push:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up JDK 21
|
||||||
|
uses: actions/setup-java@v4
|
||||||
|
with:
|
||||||
|
distribution: 'temurin'
|
||||||
|
java-version: '21'
|
||||||
|
|
||||||
|
- name: Run production build
|
||||||
|
env:
|
||||||
|
GAMEYFIN_KEYSTORE_PASSWORD: ${{ secrets.GAMEYFIN_KEYSTORE_PASSWORD }}
|
||||||
|
run: ./gradlew clean build -Pvaadin.productionMode=true
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Log in to Docker Hub
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Extract tag from branch name
|
||||||
|
id: extract_tag
|
||||||
|
run: |
|
||||||
|
BRANCH_NAME="${GITHUB_REF#refs/heads/}"
|
||||||
|
TAG="${BRANCH_NAME#fix/}"
|
||||||
|
echo "tag=$TAG" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Build and push Docker image
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: docker/Dockerfile
|
||||||
|
platforms: linux/arm64/v8,linux/amd64
|
||||||
|
push: true
|
||||||
|
tags: grimsi/gameyfin:${{ steps.extract_tag.outputs.tag }}
|
||||||
|
|
||||||
Reference in New Issue
Block a user