69 lines
1.7 KiB
YAML
69 lines
1.7 KiB
YAML
name: release-image-gitea
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 0.*
|
|
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Extract Metadata
|
|
id: meta
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
tags: |
|
|
type=ref,event=branch
|
|
type=ref,event=tag
|
|
images: ${{ vars.REPOSITORY_HOST }}/${{ gitea.repository }}
|
|
|
|
- name: Install QEMU
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y qemu-user-static
|
|
|
|
- name: Set up Docker Context for Buildx
|
|
id: buildx-context
|
|
run: |
|
|
export DOCKER_HOST=tcp://docker:2376/
|
|
export DOCKER_TLS_VERIFY=0
|
|
docker context create builders
|
|
|
|
- name: Set up Docker Buildx
|
|
id: buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
with:
|
|
endpoint: builders
|
|
env:
|
|
DOCKER_HOST: "tcp://docker:2376/"
|
|
DOCKER_TLS_VERIFY: 0
|
|
|
|
- name: Available Platforms
|
|
run: echo ${{ steps.buildx.outputs.platforms }}
|
|
|
|
- name: Login to Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ vars.REPOSITORY_HOST }}
|
|
username: ${{ gitea.actor }}
|
|
password: ${{ secrets.REPOSITORY_TOKEN }}
|
|
|
|
- name: Build and Push Image
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
push: true
|
|
platforms: linux/amd64
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
file: ./Dockerfile
|
|
env:
|
|
DOCKER_HOST: "tcp://docker:2376/"
|
|
DOCKER_TLS_VERIFY: 0
|