docker-swiss-army-knife/.forgejo/workflows/publish.yaml

52 lines
1.4 KiB
YAML
Raw Normal View History

2025-04-02 16:15:26 +02:00
name: Build images
2025-04-02 15:12:03 +02:00
on:
push:
2025-04-02 16:15:26 +02:00
branches:
- main
# Uncomment to run only when specific files change
# paths:
# - '**/ansible-navigator.yaml'
# - '**/execution-environment.yml'
env:
# Set this to the public IP or hostname of your registry,
# whichever you use to reach it from your desktop/laptop
FORGEJO_HOST: code.zeidler.dev
2025-04-02 15:12:03 +02:00
jobs:
2025-04-02 19:21:48 +02:00
build-and-push:
2025-04-07 11:49:22 +02:00
runs-on: catthehacker
2025-04-02 16:15:26 +02:00
environment: deploy
2025-04-02 15:12:03 +02:00
steps:
2025-04-02 16:15:26 +02:00
- name: Prepare environment variables
run: |
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
echo REGISTRY=${{ env.FORGEJO_HOST }} >> $GITHUB_ENV
- name: Checkout the repo
uses: actions/checkout@v4
- name: Login to the registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.PACKAGE_TOKEN }}
2025-04-07 11:49:22 +02:00
build:
2025-04-07 12:18:46 +02:00
runs-on: catthehacker
2025-04-07 11:49:22 +02:00
environment: deploy
steps:
2025-04-02 19:21:48 +02:00
- name: Set up Docker Buildx
2025-04-07 12:09:40 +02:00
uses: docker/setup-buildx-action@v3
2025-04-02 19:21:48 +02:00
with:
driver: docker-container
2025-04-02 18:13:09 +02:00
- name: Build and push
uses: docker/build-push-action@v6
with:
context: context
push: true
provenance: false
platforms: linux/amd64, linux/arm64
tags: ${{ env.REGISTRY }}/${{ github.actor }}/${{ env.CONTAINER_NAME }}:latest