Skip to content

Add GitHub registry and specify build platform #8

Add GitHub registry and specify build platform

Add GitHub registry and specify build platform #8

Workflow file for this run

name: Docker Build and Push (Python 3.11)
on:
push:
branches:
- 'main'
jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Set Envornment Variables
id: vars
run: |
echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v5
with:
platforms: linux/amd64
file: Dockerfile_py3.11
push: true
tags: |
dmri/ci-cd:latest
dmri/ci-cd:${{ env.SHORT_SHA }}
ghcr.io/muscbridge/ci-cd:latest
ghcr.io/muscbridge/ci-cd:${{ env.SHORT_SHA }}