59 lines
1.7 KiB
YAML
59 lines
1.7 KiB
YAML
name: Build and Publish Package (amd64)
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
|
|
jobs:
|
|
docker:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Log in to Gitea Container Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: gitea.jzitnik.dev
|
|
username: ${{ gitea.actor }}
|
|
password: ${{ secrets.TOKEN }}
|
|
|
|
- name: Convert Owner and Repo to Lowercase
|
|
id: string_prep
|
|
run: |
|
|
FULL_REPO="${GITHUB_REPOSITORY,,}"
|
|
OWNER="${FULL_REPO%%/*}"
|
|
REPO="${FULL_REPO#*/}"
|
|
echo "owner=$OWNER" >> $GITHUB_OUTPUT
|
|
echo "repo=$REPO" >> $GITHUB_OUTPUT
|
|
|
|
- name: Extract Metadata
|
|
id: meta
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: gitea.jzitnik.dev/${{ steps.string_prep.outputs.owner }}/${{ steps.string_prep.outputs.repo }}
|
|
tags: |
|
|
type=ref,event=branch
|
|
type=semver,pattern={{version}}
|
|
type=sha,format=short
|
|
|
|
- name: Build and Push (amd64 Fast Path)
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
file: ./Dockerfile
|
|
platforms: linux/amd64
|
|
push: true
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
cache-from: type=registry,ref=gitea.jzitnik.dev/${{ steps.string_prep.outputs.owner }}/${{ steps.string_prep.outputs.repo }}:buildcache
|
|
cache-to: type=registry,ref=gitea.jzitnik.dev/${{ steps.string_prep.outputs.owner }}/${{ steps.string_prep.outputs.repo }}:buildcache,mode=max
|