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 Image | |
on: push | |
concurrency: | |
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' | |
cancel-in-progress: true | |
jobs: | |
ci: | |
name: Build Image and Push | |
runs-on: ubuntu-latest | |
steps: | |
# https://github.com/docker/login-action#quayio | |
- name: Login to Quay.io | |
uses: docker/login-action@v3 | |
with: | |
registry: quay.io | |
username: ${{ secrets.QUAY_USERNAME }} | |
password: ${{ secrets.QUAY_ROBOT_TOKEN }} | |
# https://github.com/docker/login-action#aws-public-elastic-container-registry-ecr | |
- name: Login to ECR | |
uses: docker/login-action@v3 | |
with: | |
registry: 707767160287.dkr.ecr.us-east-1.amazonaws.com | |
username: ${{ secrets.ECR_AWS_ACCESS_KEY_ID }} | |
password: ${{ secrets.ECR_AWS_SECRET_ACCESS_KEY }} | |
env: | |
AWS_REGION: us-east-1 | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
fetch-depth: 0 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/[email protected] | |
- name: Set Variables | |
shell: bash | |
run: | | |
echo "IMAGE_TAG=orthancteam-$(echo ${GITHUB_REF#refs/*/} | tr / _)" | |
echo "IMAGE_TAG=orthancteam-$(echo ${GITHUB_REF#refs/*/} | tr / _)" >> $GITHUB_ENV | |
- name: Extract metadata | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
quay.io/cdis/${{ env.REPO_NAME }}:${{ env.IMAGE_TAG }} | |
${{ inputs.AWS_ECR_REGISTRY }}/gen3/${{ env.REPO_NAME }}:${{ env.IMAGE_TAG }} | |
# TODO linux/arm64 image | |
- name: Build linux/amd64 image | |
run: ./local-build.sh version=stable platform=linux/amd64 image=normal type=ci step=build currentTag=${{ env.IMAGE_TAG }} | |
- name: Push linux/amd64 image | |
run: ./local-build.sh version=stable platform=linux/amd64 image=normal type=ci step=push currentTag=${{ env.IMAGE_TAG }} pushTag=${{ env.IMAGE_TAG }} isTag=true |