62 lines
1.5 KiB
YAML
62 lines
1.5 KiB
YAML
name: Build and Publish Organization Package
|
|
|
|
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 QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
with:
|
|
driver: docker
|
|
|
|
- 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
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
file: ./Dockerfile
|
|
push: true
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|