Test building by digest
This commit is contained in:
@@ -1,12 +1,10 @@
|
||||
name: Build Docker Image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
schedule:
|
||||
- cron: '@monthly'
|
||||
|
||||
jobs:
|
||||
build-amd64:
|
||||
runs-on: linux_amd
|
||||
@@ -18,38 +16,38 @@ jobs:
|
||||
RUNNER_TOOL_CACHE: /toolcache
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ['3.10', '3.11', '3.12', '3.13']
|
||||
python-version: ['3.10']
|
||||
outputs:
|
||||
amd64-digest-${{ matrix.python-version }}: ${{ steps.build.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=$(echo ${GITHUB_REPOSITORY} | awk -F"/" '{print $2}') >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Build and Push AMD64
|
||||
id: build
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile.python${{ matrix.python-version }}
|
||||
platforms: linux/amd64
|
||||
push: true
|
||||
tags: gitea.technocloud.ee/${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }}:python${{ matrix.python-version }}-amd64
|
||||
provenance: false
|
||||
outputs: type=image,name=gitea.technocloud.ee/${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }},push-by-digest=true
|
||||
|
||||
build-arm64:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -61,38 +59,38 @@ jobs:
|
||||
RUNNER_TOOL_CACHE: /toolcache
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ['3.10', '3.11', '3.12', '3.13']
|
||||
python-version: ['3.10']
|
||||
outputs:
|
||||
arm64-digest-${{ matrix.python-version }}: ${{ steps.build.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=$(echo ${GITHUB_REPOSITORY} | awk -F"/" '{print $2}') >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Build and Push ARM64
|
||||
id: build
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile.python${{ matrix.python-version }}
|
||||
platforms: linux/arm64
|
||||
push: true
|
||||
tags: gitea.technocloud.ee/${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }}:python${{ matrix.python-version }}-arm64
|
||||
provenance: false
|
||||
outputs: type=image,name=gitea.technocloud.ee/${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }},push-by-digest=true
|
||||
|
||||
create-manifest:
|
||||
needs: [build-amd64, build-arm64]
|
||||
@@ -104,7 +102,7 @@ jobs:
|
||||
DOCKER_ORG: technocloud-public
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ['3.10', '3.11', '3.12', '3.13']
|
||||
python-version: ['3.10']
|
||||
steps:
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v3
|
||||
@@ -112,16 +110,14 @@ jobs:
|
||||
registry: gitea.technocloud.ee
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Get Meta
|
||||
id: meta
|
||||
run: |
|
||||
echo REPO_NAME=$(echo ${GITHUB_REPOSITORY} | awk -F"/" '{print $2}') >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Create and Push Manifest
|
||||
run: |
|
||||
docker manifest create \
|
||||
gitea.technocloud.ee/${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }}:python${{ matrix.python-version }} \
|
||||
gitea.technocloud.ee/${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }}:python${{ matrix.python-version }}-amd64 \
|
||||
gitea.technocloud.ee/${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }}:python${{ matrix.python-version }}-arm64
|
||||
gitea.technocloud.ee/${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }}@${{ needs.build-amd64.outputs.amd64-digest-${{ matrix.python-version }} }} \
|
||||
gitea.technocloud.ee/${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }}@${{ needs.build-arm64.outputs.arm64-digest-${{ matrix.python-version }} }}
|
||||
docker manifest push gitea.technocloud.ee/${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }}:python${{ matrix.python-version }}
|
||||
Reference in New Issue
Block a user