Merge pull request #169 from ckavili/main #45
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: tl500-stack-image-publish | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- '*' | |
paths: | |
- codereadyworkspaces/stack/VERSION | |
- .github/workflows/tl500-stack-image-publish.yaml | |
jobs: | |
build: | |
env: | |
context: codereadyworkspaces/stack | |
image_name: stack-tl500 | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Get image tags | |
id: image_tags | |
run: | | |
echo -n ::set-output name=IMAGE_TAGS:: | |
# exposes variable VERSION | |
source ${context}/VERSION | |
TAGS=('latest') | |
if [ "${VERSION}" ] && [ "${VERSION}" != "latest" ]; then | |
TAGS+=("${VERSION}") | |
fi | |
echo "${TAGS[*]}" | |
- name: Build image | |
id: build_image | |
uses: redhat-actions/[email protected] | |
with: | |
context: ${{ env.context }} | |
dockerfiles: | | |
./${{ env.context }}/Dockerfile | |
image: ${{ env.image_name }} | |
tags: "${{ steps.image_tags.outputs.IMAGE_TAGS }}" | |
- name: Push to Quay | |
id: push_to_quay | |
uses: redhat-actions/push-to-registry@v2 | |
with: | |
image: ${{ steps.build_image.outputs.image }} | |
registry: ${{ secrets.REGISTRY_URI }}/${{ secrets.REGISTRY_REPOSITORY }} | |
username: ${{ secrets.REGISTRY_USERNAME }} | |
password: ${{ secrets.REGISTRY_PASSWORD }} | |
tags: ${{ steps.build_image.outputs.tags }} |