forked from orthanc-server/orthanc-builder
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e362d72
commit dd1ace3
Showing
4 changed files
with
143 additions
and
65 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
name: Build and Push Image | ||
on: push | ||
|
||
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: ${{ inputs.AWS_ECR_REGISTRY }} | ||
# username: ${{ secrets.ECR_AWS_ACCESS_KEY_ID }} | ||
# password: ${{ secrets.ECR_AWS_SECRET_ACCESS_KEY }} | ||
# env: | ||
# AWS_REGION: ${{ inputs.AWS_REGION }} | ||
|
||
- 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=$(echo ${GITHUB_REF#refs/*/} | tr / _)" | ||
echo "IMAGE_TAG=$(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 }} | ||
|
||
# - name: Build and push | ||
# if: ${{ !inputs.USE_QUAY_ONLY }} | ||
# uses: docker/build-push-action@v6 | ||
# # You may get ECR-push errors when first adding the workflow to a github repo. | ||
# # If so, run the following in dev/qa to create the ECR repository: | ||
# # qaplanetv1@cdistest_dev_admin:~$ aws ecr create-repository --repository-name "gen3/<repo name>" --image-scanning-configuration scanOnPush=true | ||
# with: | ||
# context: ${{ inputs.DOCKERFILE_BUILD_CONTEXT }} | ||
# file: ${{ inputs.DOCKERFILE_LOCATION }} | ||
# push: true | ||
# tags: | | ||
# ${{ inputs.AWS_ECR_REGISTRY }}/gen3/${{ env.REPO_NAME }}:${{ env.IMAGE_TAG }} | ||
# quay.io/cdis/${{ env.REPO_NAME }}:${{ env.IMAGE_TAG }} | ||
# labels: ${{ steps.meta.outputs.labels }} | ||
# cache-from: type=registry,ref=${{ inputs.AWS_ECR_REGISTRY }}/gen3/${{ env.REPO_NAME }}:cache | ||
# cache-to: type=registry,ref=${{ inputs.AWS_ECR_REGISTRY }}/gen3/${{ env.REPO_NAME }}:cache,mode=max,image-manifest=true,oci-mediatypes=true | ||
# platforms: ${{ inputs.BUILD_PLATFORMS }} | ||
|
||
# - name: Build and push (Quay only) | ||
# if: ${{ inputs.USE_QUAY_ONLY }} | ||
# uses: docker/build-push-action@v6 | ||
# with: | ||
# context: ${{ inputs.DOCKERFILE_BUILD_CONTEXT }} | ||
# file: ${{ inputs.DOCKERFILE_LOCATION }} | ||
# push: true | ||
# tags: | | ||
# quay.io/cdis/${{ env.REPO_NAME }}:${{ env.IMAGE_TAG }} | ||
# labels: ${{ steps.meta.outputs.labels }} | ||
# platforms: ${{ inputs.BUILD_PLATFORMS }} | ||
|
||
# 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 }}-normal-stable | ||
|
||
- name: Push linux/amd64 image | ||
run: ./local-build.sh version=stable platform=linux/amd64 image=normal type=ci step=push currentTag=${{ env.IMAGE_TAG }}-normal-stable pushTag=${{ env.IMAGE_TAG }} isTag=true |
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
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
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