59 lines
1.4 KiB
YAML
59 lines
1.4 KiB
YAML
name: Build and Publish TVJ EPG Image
|
|
|
|
on:
|
|
push:
|
|
branches: [ "main" ]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Read version
|
|
id: version
|
|
run: |
|
|
VERSION=$(cat VERSION | tr -d ' \n')
|
|
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
|
|
|
- name: Install Podman
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y podman
|
|
|
|
- name: Log in to GitHub Container Registry
|
|
run: |
|
|
echo "${{ secrets.GHCR_TOKEN }}" | podman login ghcr.io \
|
|
-u ${{ github.actor }} \
|
|
--password-stdin
|
|
|
|
- name: Build image with Podman (multi-tag)
|
|
run: |
|
|
IMAGE=ghcr.io/${{ github.repository }}
|
|
VERSION=${{ steps.version.outputs.version }}
|
|
SHORT_SHA=${GITHUB_SHA::7}
|
|
|
|
podman build \
|
|
-f Containerfile \
|
|
-t $IMAGE:latest \
|
|
-t $IMAGE:v$VERSION \
|
|
-t $IMAGE:sha-$SHORT_SHA \
|
|
.
|
|
|
|
- name: Push all tags
|
|
run: |
|
|
IMAGE=ghcr.io/${{ github.repository }}
|
|
VERSION=${{ steps.version.outputs.version }}
|
|
SHORT_SHA=${GITHUB_SHA::7}
|
|
|
|
podman push $IMAGE:latest
|
|
podman push $IMAGE:v$VERSION
|
|
podman push $IMAGE:sha-$SHORT_SHA
|