Publish an input docker image to the AWS ECR with the version specified #16
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
# SPDX-FileCopyrightText: 2022 Renaissance Computing Institute. All rights reserved. | |
# SPDX-FileCopyrightText: 2023 Renaissance Computing Institute. All rights reserved. | |
# SPDX-FileCopyrightText: 2024 Renaissance Computing Institute. All rights reserved. | |
# | |
# SPDX-License-Identifier: GPL-3.0-or-later | |
# SPDX-License-Identifier: LicenseRef-RENCI | |
# SPDX-License-Identifier: MIT | |
name: Publish an input docker image to the AWS ECR with the version specified | |
on: | |
workflow_dispatch: | |
inputs: | |
in_container: | |
description: "The name of the input image name (:latest presumed)" | |
required: true | |
version: | |
description: "The image version that will be the image tag in AWS/ECR" | |
required: true | |
# job definition | |
jobs: | |
Build-and-publish-image: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
# job steps | |
steps: | |
# pull the docker image, latest is presumed | |
- name: pull the docker image | |
id: pull-it | |
run: docker pull containers.renci.org/eds/${{ github.event.inputs.in_container }} | |
# list the images for confirmation | |
- name: list images 1 | |
run: docker images | |
# push the image to AWS/ECR | |
- name: Push to ECR | |
id: ecr | |
uses: jwalton/gh-ecr-push@v1 | |
with: | |
access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
region: us-east-2 | |
local-image: containers.renci.org/eds/${{ github.event.inputs.in_container }} | |
image: ${{ github.event.inputs.in_container }}, ${{ github.event.inputs.in_container }}:${{ github.event.inputs.version }} |