Build separate for gh #7
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 Multi-Platform Docker Image | |
on: | |
workflow_dispatch: | |
inputs: | |
branch: | |
description: 'Branch to run the workflow on' | |
default: 'main' | |
required: true | |
push: | |
branches: | |
- main | |
- update-docker-images | |
paths: | |
- 'images/ig-publisher/**' | |
jobs: | |
build-and-push: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to GHCR | |
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin | |
- name: Build and push multi-platform image for localdev | |
run: | | |
docker buildx build --push \ | |
--platform linux/amd64,linux/arm64 \ | |
--target localdev \ | |
-t ghcr.io/fhir/ig-publisher-localdev:latest \ | |
images/ig-publisher | |
- name: Build and push image for gh | |
run: | | |
docker buildx build --push \ | |
--platform linux/amd64 \ | |
--target gh \ | |
-t ghcr.io/fhir/ig-publisher-gh:latest \ | |
images/ig-publisher |