Skip to content

Commit

Permalink
Simplify docker publich using tags
Browse files Browse the repository at this point in the history
  • Loading branch information
carlreid committed Feb 7, 2025
1 parent f06823f commit ae3d3ec
Show file tree
Hide file tree
Showing 9 changed files with 224 additions and 335 deletions.
174 changes: 0 additions & 174 deletions .github/workflows/Manual_Publish_Docker.yml

This file was deleted.

63 changes: 63 additions & 0 deletions .github/workflows/publish_container.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Publish Docker with SemVer
on:
push:
tags:
- 'v*'

permissions:
contents: read
packages: write

env:
REGISTRY_IMAGE: ghcr.io/${{ github.repository_owner }}/streammaster

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
platform:
- linux/amd64
- linux/arm64

steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Extract SemVer from Tag
id: semver
run: |
TAG_NAME=${GITHUB_REF#refs/tags/} # Get the tag name directly
echo "TAG=$TAG_NAME" >> $GITHUB_OUTPUT
VERSION="${TAG_NAME#v}" #remove the v
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
platforms: ${{ matrix.platform }}
push: true
tags: |
${{ env.REGISTRY_IMAGE }}:${{ steps.semver.outputs.VERSION }}
${{ env.REGISTRY_IMAGE }}:latest
labels: |
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.source=https://github.com/${{ github.repository }}
org.opencontainers.image.version=${{ steps.semver.outputs.VERSION }}
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,6 @@ ffmpeg/ffmpeg
epg.xml
m3u.m3u
ghtoken
Dockerfile
Dockerfile.sm
basever
buildver
smver
Expand Down
Loading

0 comments on commit ae3d3ec

Please sign in to comment.