Skip to content
name: Build and publish the docker image to RENCI container registry
# trigger event is publishing a release in the repo
on:
release:
types: [published]
# working parameters that are specific to this script
env:
REGISTRY: containers.renci.org/renci-dot-org/frontend
# job definition
jobs:
Build-and-publish-image:
runs-on: ubuntu-latest
permissions:
contents: read
# job steps
steps:
# checkout the codebase
- name: Checkout
uses: actions/checkout@v3
# connect to the renci image registry
- name: Login to containers.renci.org
uses: docker/login-action@v2
with:
registry: containers.renci.org
username: ${{ secrets.USER }}
password: ${{ secrets.PW }}
# get the tag for the image
- name: Get the version
id: get_version
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
# build and push the image. The docker v3 action automatically handles the git checkout.
- name: Build/Push the image to the registry
uses: docker/build-push-action@v4
with:
push: true
build-args: |
VERSION=${{ steps.get_version.outputs.VERSION }}
tags: |
${{ env.REGISTRY }}:latest
${{ env.REGISTRY }}:${{ steps.get_version.outputs.VERSION }}