wg-manager/.forgejo/workflows/build_container-worker.yaml

63 lines
1.7 KiB
YAML
Raw Normal View History

2024-11-14 12:29:14 +01:00
name: Create and publish Worker container image
on:
push:
2024-11-14 12:29:14 +01:00
branches: ["*"]
release:
types: [published]
2024-11-14 12:23:02 +01:00
workflow_dispatch:
env:
2024-11-14 22:02:51 +01:00
REGISTRY: git.lattuga.net
2024-11-14 21:51:12 +01:00
IMAGE_NAME: ${{github.repository}}/wg-manager-worker
jobs:
build-and-push-image:
runs-on: ubuntu-22.04
permissions:
contents: read
packages: write
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Checkout repository
uses: actions/checkout@v3
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
2024-11-14 12:29:14 +01:00
registry: ${{ env.REGISTRY }}
2024-11-14 21:36:07 +01:00
username: ${{ github.repository_owner }}
password: ${{ secrets.PAT }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: https://github.com/docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
2024-11-14 23:40:59 +01:00
- name: Copy .env
run: cp .env-dist .env
2024-11-14 23:49:45 +01:00
- name: Link settings.py
run: ln -s settings_dist.py wg_manager/settings.py
- name: Build and push Docker image FE
uses: docker/build-push-action@v6
with:
context: .
2024-11-14 23:49:45 +01:00
platforms: linux/amd64
#,linux/arm64
file: Containerfile-worker
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}