ansible split build
Some checks failed
Some checks failed
This commit is contained in:
parent
ffe5142e0d
commit
5297197289
3 changed files with 76 additions and 79 deletions
|
|
@ -20,19 +20,23 @@ env:
|
|||
USER: hbms
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
# runs-on: docker
|
||||
runs-on: arm64
|
||||
build-and-push-arch:
|
||||
runs-on: ${{ matrix.arch }}
|
||||
strategy:
|
||||
matrix:
|
||||
arch: [ amd64, arm64 ]
|
||||
container:
|
||||
image: ghcr.io/catthehacker/ubuntu:act-22.04
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
- name: Prepare environment variables
|
||||
run: |
|
||||
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
|
||||
echo REGISTRY=${{ vars.REGISTRY }} >> $GITHUB_ENV
|
||||
|
||||
- name: Checkout the repo
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Login to Forgejo Container Registry
|
||||
- name: Login to the registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ vars.REGISTRY }}
|
||||
|
|
@ -42,9 +46,19 @@ jobs:
|
|||
- name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: ./containers/ansible/
|
||||
file: ./containers/ansible/Dockerfile
|
||||
context: context
|
||||
push: true
|
||||
provenance: false
|
||||
platforms: linux/amd64, linux/arm64
|
||||
tags: ${{ vars.REGISTRY }}/${{ env.USER }}/${{ env.CONTAINER_NAME }}:latest
|
||||
tags: ${{ vars.REGISTRY }}/${{ env.USER }}/${{ env.CONTAINER_NAME }}-${{ matrix.arch }}:latest
|
||||
|
||||
merge-images-via-manifest:
|
||||
runs-on: catthehacker-amd64
|
||||
needs: build-and-push-arch
|
||||
environment: deploy
|
||||
steps:
|
||||
- name: Generate and push multi-arch manifest
|
||||
run: |
|
||||
echo REGISTRY=${{ vars.REGISTRY }} >> $GITHUB_ENV
|
||||
echo ${{ secrets.PACKAGE_TOKEN }} | docker login ${{ vars.REGISTRY }} -u ${USER} --password-stdin
|
||||
docker manifest create ${{ vars.REGISTRY }}/${USER}/${{ env.CONTAINER_NAME }}:latest ${{ vars.REGISTRY }}/${USER}/${{ env.CONTAINER_NAME }}-amd64:latest ${{ vars.REGISTRY }}/${USER}/${{ env.CONTAINER_NAME }}-arm64:latest
|
||||
docker manifest push ${{ vars.REGISTRY }}/${USER}/${{ env.CONTAINER_NAME }}:latest
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue