59 lines
1.5 KiB
YAML
59 lines
1.5 KiB
YAML
name: ci
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
- staging
|
|
tags:
|
|
- '*'
|
|
|
|
env:
|
|
IMAGE_NAME: ${{ vars.REGISTRY_URL }}/${{ gitea.repository }}
|
|
TAG_SUFFIX: ${{ gitea.ref_type == 'tag' && gitea.ref_name || (gitea.ref_name == 'master' && 'latest' || gitea.ref_name) }}
|
|
|
|
jobs:
|
|
docker:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout with submodules
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: recursive
|
|
token: ${{ secrets.GIT_PAT }}
|
|
|
|
- name: Login to Docker Registry
|
|
uses: docker/login-action@v2
|
|
with:
|
|
registry: ${{ vars.REGISTRY_URL }}
|
|
username: ${{ vars.REGISTRY_USER }}
|
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
with:
|
|
driver: remote
|
|
endpoint: ${{ env.BUILDKIT_ARM64_ENDPOINT }}
|
|
|
|
- name: Show build context
|
|
run: |
|
|
echo "Repository: ${{ gitea.repository }}"
|
|
echo "Actor: ${{ gitea.actor }}"
|
|
echo "Ref: ${{ gitea.ref }}"
|
|
echo "SHA: ${{ gitea.sha }}"
|
|
|
|
- name: Build and Push Docker Image
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
file: contrib/docker/Dockerfile
|
|
platforms: linux/arm64
|
|
build-args: |
|
|
BASE_IMAGE=debian:bullseye
|
|
GIT_REVISION=${{ gitea.sha }}
|
|
push: true
|
|
tags: |
|
|
${{ env.IMAGE_NAME }}:${{ env.TAG_SUFFIX }}
|
|
${{ env.IMAGE_NAME }}:${{ gitea.sha }}
|