(chore) #485: Implement Multi-Architecture Docker Image Build and Deployment with Debian Base Image #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Push Docker Image | ||
on: | ||
pull_request: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- master | ||
tags: | ||
- 'v*.*' | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
env: | ||
IMAGE_NAME: index.docker.io/metacall/core | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
platform: | ||
- linux/amd64 | ||
- linux/arm/v6 | ||
- linux/arm/v7 | ||
- linux/arm64 | ||
steps: | ||
- name: Checkout the code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_HUB_USERNAME }} | ||
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | ||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ env.IMAGE_NAME }} | ||
- name: Prepare | ||
run: | | ||
Check failure on line 56 in .github/workflows/multiarch-dockerhub.yml
|
||
echo "METACALL_PLATFORM=${{ matrix.platform //\//- }}" >> $GITHUB_ENV | ||
- name: Build and Push Multi-Architecture Images | ||
run: | | ||
bash ./docker-compose.sh build-multiarch | ||
# - name: Export digest | ||
# id: export_digest | ||
# run: | | ||
# digest=$(docker inspect --format='{{index .RepoDigests 0}}' ${{ env.IMAGE_NAME }}:latest) | ||
# echo "DIGEST=${digest#*:}" >> $GITHUB_ENV | ||
- name: Logout from DockerHub | ||
run: docker logout | ||
# create-manifest: | ||
# needs: build | ||
# steps: | ||
# - name: Checkout the code | ||
# uses: actions/checkout@v3 | ||
# - name: Set up Docker Buildx | ||
# uses: docker/setup-buildx-action@v3 | ||
# - name: Login to DockerHub | ||
# uses: docker/login-action@v2 | ||
# with: | ||
# username: ${{ secrets.DOCKER_HUB_USERNAME }} | ||
# password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | ||
# - name: Create manifest list and push | ||
# run: | | ||
# docker buildx imagetools create --tag ${{ env.IMAGE_NAME }}:latest \ | ||
# --tag ${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }} \ | ||
# ${{ env.IMAGE_NAME }}@sha256:${{ env.DIGEST }} | ||
- name: Inspect image | ||
run: docker buildx imagetools inspect ${{ env.IMAGE_NAME }}:latest | ||
- name: Logout from DockerHub | ||
run: docker logout |