Test 27
This commit is contained in:
@@ -6,140 +6,23 @@ on:
|
|||||||
schedule:
|
schedule:
|
||||||
- cron: '@monthly'
|
- cron: '@monthly'
|
||||||
jobs:
|
jobs:
|
||||||
# build-amd64:
|
job1:
|
||||||
# runs-on: linux_amd
|
|
||||||
# name: Build AMD64
|
|
||||||
# container:
|
|
||||||
# image: catthehacker/ubuntu:act-latest
|
|
||||||
# env:
|
|
||||||
# RUNNER_TOOL_CACHE: /toolcache
|
|
||||||
# strategy:
|
|
||||||
# matrix:
|
|
||||||
# python-version: ['3.10', '3.11', '3.12', '3.13']
|
|
||||||
# outputs:
|
|
||||||
# digest-3-10: ${{ steps.digest-3-10.outputs.digest }}
|
|
||||||
# digest-3-11: ${{ steps.digest-3-11.outputs.digest }}
|
|
||||||
# digest-3-12: ${{ steps.digest-3-12.outputs.digest }}
|
|
||||||
# digest-3-13: ${{ steps.digest-3-13.outputs.digest }}
|
|
||||||
# steps:
|
|
||||||
# - name: Checkout
|
|
||||||
# uses: actions/checkout@v4
|
|
||||||
# with:
|
|
||||||
# github-server-url: https://gitea.technocloud.ee
|
|
||||||
# - name: Set up Docker BuildX
|
|
||||||
# uses: docker/setup-buildx-action@v3
|
|
||||||
# with:
|
|
||||||
# platforms: linux/amd64
|
|
||||||
# - name: Login to DockerHub
|
|
||||||
# uses: docker/login-action@v3
|
|
||||||
# with:
|
|
||||||
# registry: gitea.technocloud.ee
|
|
||||||
# username: ${{ secrets.DOCKER_USERNAME }}
|
|
||||||
# password: ${{ secrets.DOCKER_PASSWORD }}
|
|
||||||
# - name: Get Meta
|
|
||||||
# id: meta
|
|
||||||
# run: |
|
|
||||||
# echo "REPO_NAME=${GITHUB_REPOSITORY}" >> $GITHUB_OUTPUT
|
|
||||||
# - name: Build and Push AMD64
|
|
||||||
# id: build-docker
|
|
||||||
# uses: docker/build-push-action@v5
|
|
||||||
# with:
|
|
||||||
# context: .
|
|
||||||
# file: Dockerfile.python${{ matrix.python-version }}
|
|
||||||
# platforms: linux/amd64
|
|
||||||
# push: true
|
|
||||||
# provenance: false
|
|
||||||
# outputs: type=image,name=gitea.technocloud.ee/${{ steps.meta.outputs.REPO_NAME }},push-by-digest=true
|
|
||||||
# - name: Summarize the Docker digest
|
|
||||||
# id: digest
|
|
||||||
# run: |
|
|
||||||
# PY_VERSION=${{ matrix.python-version }}
|
|
||||||
# PY_VERSION_MOD=$(echo $PY_VERSION | sed 's/\./_/g')
|
|
||||||
# echo DIGEST_${PY_VERSION_MOD}="${{ steps.build-docker.outputs.digest }}" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
build-arm64:
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
name: Build ARM64
|
|
||||||
container:
|
|
||||||
image: catthehacker/ubuntu:act-latest
|
|
||||||
env:
|
|
||||||
RUNNER_TOOL_CACHE: /toolcache
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
python-version: ['3.10', '3.11', '3.12', '3.13']
|
|
||||||
outputs:
|
outputs:
|
||||||
digest-3-10: ${{ steps.digest-3-10.outputs.digest }}
|
output_1: ${{ steps.gen_output.outputs.output_1 }}
|
||||||
digest-3-11: ${{ steps.digest-3-11.outputs.digest }}
|
output_2: ${{ steps.gen_output.outputs.output_2 }}
|
||||||
digest-3-12: ${{ steps.digest-3-12.outputs.digest }}
|
output_3: ${{ steps.gen_output.outputs.output_3 }}
|
||||||
digest-3-13: ${{ steps.digest-3-13.outputs.digest }}
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
github-server-url: https://gitea.technocloud.ee
|
|
||||||
- name: Set up Docker BuildX
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
with:
|
|
||||||
platforms: linux/arm64
|
|
||||||
- name: Login to DockerHub
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
registry: gitea.technocloud.ee
|
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
||||||
- name: Get Meta
|
|
||||||
id: meta
|
|
||||||
run: |
|
|
||||||
echo "REPO_NAME=${GITHUB_REPOSITORY}" >> $GITHUB_OUTPUT
|
|
||||||
- name: Build and Push ARM64
|
|
||||||
id: build-docker
|
|
||||||
uses: docker/build-push-action@v6
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
file: Dockerfile.python${{ matrix.python-version }}
|
|
||||||
platforms: linux/arm64
|
|
||||||
push: true
|
|
||||||
provenance: false
|
|
||||||
outputs: type=image,name=gitea.technocloud.ee/${{ steps.meta.outputs.REPO_NAME }},push-by-digest=true
|
|
||||||
- name: Summarize the Docker digest
|
|
||||||
id: digest-${{ matrix.python-version }}
|
|
||||||
run: |
|
|
||||||
echo "digest=${{ steps.build-docker.outputs.digest }}" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
|
|
||||||
create-manifest:
|
|
||||||
needs: [build-arm64]
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
name: Create Multi-arch Manifest
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
python-version: ['3.10', '3.11', '3.12', '3.13']
|
version: [1, 2, 3]
|
||||||
steps:
|
steps:
|
||||||
- name: Login to Docker Registry
|
- name: Generate output
|
||||||
uses: docker/login-action@v3
|
id: gen_output
|
||||||
with:
|
|
||||||
registry: gitea.technocloud.ee
|
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
||||||
|
|
||||||
- name: Set up Docker BuildX
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
with:
|
|
||||||
driver: docker-container
|
|
||||||
|
|
||||||
- name: Get Repository Metadata
|
|
||||||
id: meta
|
|
||||||
run: |
|
run: |
|
||||||
echo "PACKAGE=gitea.technocloud.ee/${GITHUB_REPOSITORY}" >> $GITHUB_OUTPUT
|
version="${{ matrix.version }}"
|
||||||
echo "PY_VERSION=digest-$(echo ${{ matrix.python-version }} | sed 's/\./-/g')" >> $GITHUB_OUTPUT
|
echo "output_${version}=${version}" >> "$GITHUB_OUTPUT"
|
||||||
|
job2:
|
||||||
- name: Create and Push Multi-arch Manifest
|
runs-on: ubuntu-latest
|
||||||
run: |
|
needs: [job1]
|
||||||
echo '${{ toJSON(needs.build-arm64.outputs) }}'
|
steps:
|
||||||
echo '${{ toJSON(needs.build-amd64.outputs) }}'
|
- run: echo '${{ toJSON(needs.job1.outputs) }}'
|
||||||
echo '${{ steps.meta.outputs.PY_VERSION }}'
|
|
||||||
ARM_DIGEST=${{ needs.build-arm64.outputs[steps.meta.outputs.PY_VERSION] }}
|
|
||||||
AMD_DIGEST=${{ needs.build-amd64.outputs[steps.meta.outputs.PY_VERSION] }}
|
|
||||||
IMAGE_NAME=${{ steps.meta.outputs.PACKAGE }}:python${{ matrix.python-version }}
|
|
||||||
docker manifest create $IMAGE_NAME --amend ${{ steps.meta.outputs.PACKAGE }}@${ARM_DIGEST} --amend ${{ steps.meta.outputs.PACKAGE }}@${AMD_DIGEST}
|
|
||||||
docker manifest push $IMAGE_NAME
|
|
||||||
Reference in New Issue
Block a user