Update .github/workflows/build
Some checks failed
Build and Publish TVJ EPG Image / build (push) Failing after 1s
Some checks failed
Build and Publish TVJ EPG Image / build (push) Failing after 1s
This commit is contained in:
58
.github/workflows/build
vendored
Normal file
58
.github/workflows/build
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
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
|
||||
Reference in New Issue
Block a user