ansbile qemu cross create ?
Some checks failed
Build and Push Ansible Container / build-and-push (push) Failing after 33s
Some checks failed
Build and Push Ansible Container / build-and-push (push) Failing after 33s
This commit is contained in:
parent
f468bfefc0
commit
78c740e50c
2 changed files with 79 additions and 48 deletions
|
|
@ -14,12 +14,13 @@ on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 20 * * 5' # Runs every Friday at 8 PM UTC
|
- cron: '0 20 * * 5' # Runs every Friday at 8 PM UTC
|
||||||
|
|
||||||
|
env:
|
||||||
|
CONTAINER_NAME: ansible
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-push:
|
build-and-push:
|
||||||
strategy:
|
# runs-on: docker
|
||||||
matrix:
|
runs-on: arm64
|
||||||
arch: [ amd64, arm64 ]
|
|
||||||
runs-on: ${{ matrix.arch }}
|
|
||||||
container:
|
container:
|
||||||
image: ghcr.io/catthehacker/ubuntu:act-22.04
|
image: ghcr.io/catthehacker/ubuntu:act-22.04
|
||||||
steps:
|
steps:
|
||||||
|
|
@ -36,49 +37,12 @@ jobs:
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.PACKAGE_TOKEN }}
|
password: ${{ secrets.PACKAGE_TOKEN }}
|
||||||
|
|
||||||
- name: Build and push (${{ matrix.arch }})
|
- name: Build and push
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: ./containers/ansible/
|
context: ./containers/${{ CONTAINER_NAME }}/
|
||||||
file: ./containers/ansible/Dockerfile
|
file: ./containers/${{ CONTAINER_NAME }}/Dockerfile
|
||||||
platforms: linux/${{ matrix.arch }}
|
|
||||||
push: true
|
push: true
|
||||||
tags: |
|
provenance: false
|
||||||
${{ vars.REGISTRY }}/${{ github.actor }}/ansible:${{ matrix.arch }}-latest
|
platforms: linux/amd64, linux/arm64
|
||||||
|
tags: ${{ env.REGISTRY }}/${{ github.actor }}/${{ env.CONTAINER_NAME }}:latest
|
||||||
manifest:
|
|
||||||
needs: build-and-push
|
|
||||||
runs-on: amd64
|
|
||||||
services:
|
|
||||||
dind:
|
|
||||||
image: docker:dind
|
|
||||||
privileged: true
|
|
||||||
env:
|
|
||||||
DOCKER_HOST: tcp://dind:2375
|
|
||||||
steps:
|
|
||||||
- name: Wait for Docker to start
|
|
||||||
run: |
|
|
||||||
i=0
|
|
||||||
while ! docker info >/dev/null 2>&1; do
|
|
||||||
i=$((i+1))
|
|
||||||
if [ $i -ge 15 ]; then
|
|
||||||
echo "Docker did not start within 15 seconds"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
echo "Waiting for Docker to start..."
|
|
||||||
sleep 1
|
|
||||||
done
|
|
||||||
|
|
||||||
- name: Login to Forgejo Registry
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
registry: ${{ secrets.CI_REGISTRY }}
|
|
||||||
username: ${{ secrets.CI_REGISTRY_USER }}
|
|
||||||
password: ${{ secrets.CI_TOKEN }}
|
|
||||||
|
|
||||||
- name: Create and push multi-arch manifest
|
|
||||||
run: |
|
|
||||||
docker manifest create ${{ secrets.CI_REGISTRY }}/${{ secrets.CI_REPOSITORY }}/ansible:latest \
|
|
||||||
--amend ${{ secrets.CI_REGISTRY }}/${{ secrets.CI_REPOSITORY }}/ansible:amd64-latest \
|
|
||||||
--amend ${{ secrets.CI_REGISTRY }}/${{ secrets.CI_REPOSITORY }}/ansible:arm64-latest
|
|
||||||
docker manifest push ${{ secrets.CI_REGISTRY }}/${{ secrets.CI_REPOSITORY }}/ansible:latest
|
|
||||||
|
|
|
||||||
67
.forgejo/workflows/ansible.yml-old
Normal file
67
.forgejo/workflows/ansible.yml-old
Normal file
|
|
@ -0,0 +1,67 @@
|
||||||
|
# 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
|
||||||
Loading…
Add table
Add a link
Reference in a new issue