90 lines
3.0 KiB
YAML
90 lines
3.0 KiB
YAML
name: Deploy Container Image to Registry
|
|
on:
|
|
schedule:
|
|
- cron: 0 1 * * *
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
docker-build-stable:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
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
|
|
|
|
- name: Login to Docker Hub
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: gitea.gnilebein.de
|
|
username: ${{ gitea.repository_owner }}
|
|
password: ${{ secrets.REG_GITEA_PASSWORD }}
|
|
|
|
- name: Get Meta
|
|
id: meta
|
|
run: |
|
|
echo VERSION=$(git ls-remote --tags -q https://github.com/rspamd/rspamd | sed -n "s/^[[:xdigit:]]\{40\}[[:blank:]]refs\/tags\/\([0-9]\{1\}\.[0-9]\{1,2\}\($\|\.[0-9]\{1,2\}$\)\)/\1/p" | sort --version-sort | tail -1) | tee -a $GITHUB_OUTPUT
|
|
echo IMAGE_CREATED=$(date -u +"%Y-%m-%dT%H:%M:%SZ") | tee -a $GITHUB_OUTPUT
|
|
$VERSION=${{ steps.meta.outputs.VERSION }}
|
|
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: ./Stable
|
|
file: Stable/Dockerfile
|
|
platforms: linux/amd64
|
|
pull: false
|
|
push: true
|
|
no-cache: true
|
|
build-args: |
|
|
VERSION=${{ steps.meta.outputs.VERSION }}
|
|
IMAGE_CREATED=${{ steps.meta.outputs.IMAGE_CREATED }}
|
|
tags: |
|
|
${{ vars.DOCKER_REPO }}/${{ gitea.repository_owner }}/${{ vars.IMAGE_NAME }}
|
|
${{ vars.DOCKER_REPO }}/${{ gitea.repository_owner }}/${{ vars.IMAGE_NAME }}:${{ steps.meta.outputs.VERSION }}
|
|
|
|
docker-build-experimental:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
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
|
|
|
|
- name: Login to Docker Hub
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: gitea.gnilebein.de
|
|
username: ${{ gitea.repository_owner }}
|
|
password: ${{ secrets.REG_GITEA_PASSWORD }}
|
|
|
|
- name: Get Meta
|
|
id: meta
|
|
run: |
|
|
echo VERSION=$(curl -s https://rspamd.com/apt/pool/main/r/rspamd/ | sed -n "s/^<a href=\"rspamd_\(.*\)\~git.*\~.*.dsc\".*/\1/p" | tail -1) | tee -a $GITHUB_OUTPUT
|
|
echo IMAGE_CREATED=$(date -u +"%Y-%m-%dT%H:%M:%SZ") | tee -a $GITHUB_OUTPUT
|
|
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: ./Experimental
|
|
file: Experimental/Dockerfile
|
|
platforms: linux/amd64
|
|
pull: false
|
|
push: true
|
|
no-cache: true
|
|
build-args: |
|
|
VERSION=${{ steps.meta.outputs.VERSION }}
|
|
IMAGE_CREATED=${{ steps.meta.outputs.IMAGE_CREATED }}
|
|
tags: |
|
|
${{ vars.DOCKER_REPO }}/${{ gitea.repository_owner }}/${{ vars.IMAGE_NAME }}:experimental |