Some checks failed
Build and Push Ansible Container / build-and-push (push) Failing after 33s
67 lines
1.9 KiB
Text
67 lines
1.9 KiB
Text
# Workflow name
|
|
name: Build and Push Ansible Container
|
|
|
|
# Run-name for each workflow run
|
|
run-name: Build and Push Ansible Container
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- 'containers/ansible/**'
|
|
- '.forgejo/workflows/ansible.yml'
|
|
workflow_dispatch: {}
|
|
schedule:
|
|
- cron: '0 20 * * 5' # Runs every Friday at 8 PM UTC
|
|
|
|
jobs:
|
|
build-and-push:
|
|
strategy:
|
|
matrix:
|
|
arch: [ amd64, arm64 ]
|
|
runs-on: ${{ matrix.arch }}
|
|
container:
|
|
image: ghcr.io/catthehacker/ubuntu:act-22.04
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Login to Forgejo Container Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ vars.REGISTRY }}
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.PACKAGE_TOKEN }}
|
|
|
|
- name: Build and push (${{ matrix.arch }})
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: ./containers/ansible/
|
|
file: ./containers/ansible/Dockerfile
|
|
platforms: linux/${{ matrix.arch }}
|
|
push: true
|
|
tags: |
|
|
${{ vars.REGISTRY }}/${{ github.actor }}/ansible:${{ matrix.arch }}-latest
|
|
|
|
manifest:
|
|
needs: build-and-push
|
|
runs-on: amd64
|
|
container:
|
|
image: ghcr.io/catthehacker/ubuntu:act-22.04
|
|
steps:
|
|
- name: Login to Forgejo Container Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ vars.REGISTRY }}
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.PACKAGE_TOKEN }}
|
|
|
|
- name: Create and push multi-arch manifest
|
|
run: |
|
|
docker manifest create ${{ vars.REGISTRY }}/${{ github.actor }}/ansible:latest \
|
|
--amend ${{ vars.REGISTRY }}/${{ github.actor }}/ansible:amd64-latest \
|
|
--amend ${{ vars.REGISTRY }}/${{ github.actor }}/ansible:arm64-latest
|
|
docker manifest push ${{ vars.REGISTRY }}/${{ github.actor }}/ansible:latest
|