fix: publish first catalyst community version #22
Workflow file for this run
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: Image Release | |
on: | |
pull_request: | |
types: | |
- closed | |
branches: | |
- main | |
paths: | |
- "Dockerfile" | |
jobs: | |
release: | |
if: github.event.pull_request.merged == true | |
name: Release Image | |
runs-on: ubuntu-latest | |
outputs: | |
new_release_published: "${{ steps.release.outputs.new_release_published }}" | |
new_release_version: "${{ steps.release.outputs.new_release_version }}" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.AUTOMATION_PAT }} | |
fetch-depth: 0 | |
- name: Setup Docker buildx | |
uses: docker/setup-buildx-action@v2 | |
# with: | |
# install: true - | |
- name: setup git config | |
run: | | |
git config --global user.name "Catalyst Community Automation" | |
git config --global user.email "<[email protected]>" | |
- name: Get semver-tags | |
run: | | |
wget -c https://github.com/catalystcommunity/semver-tags/releases/download/v0.3.2/semver-tags.tar.gz -O - | tar -xz | |
- name: Semver Tags Run | |
id: semver-tags | |
run: | | |
./.github/scripts/do-image-release.sh fullrun | |
- if: steps.semver-tags.outputs.RELEASED_CHANGES == 'true' | |
name: Login to Quay.io Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: quay.io | |
username: ${{ secrets.QUAY_DOCKER_REGISTRY_USER }} | |
password: ${{ secrets.QUAY_DOCKER_REGISTRY_PASSWORD }} | |
- if: steps.semver-tags.outputs.RELEASED_CHANGES == 'true' | |
name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
# list of Docker images to use as base name for tags | |
images: | | |
quay.io/catalystcommunity/catalyst-runner-image | |
# generate Docker tags based on the following events/attributes | |
# tags: | | |
# type=semver,pattern=${{ steps.semver-tags.outputs.New_release_version }} | |
# type=semver,pattern=${{ steps.semver-tags.outputs.New_release_major_version }}.${{ steps.semver-tags.outputs.New_release_minor_version }} | |
# type=semver,pattern=${{ steps.semver-tags.outputs.New_release_major_version }} | |
tags: | | |
type=raw,value=latest | |
type=raw,value=${{ steps.semver-tags.outputs.New_release_version }} | |
type=raw,value=${{ steps.semver-tags.outputs.New_release_major_version }}.${{ steps.semver-tags.outputs.New_release_minor_version }} | |
type=raw,value=${{ steps.semver-tags.outputs.New_release_major_version }} | |
- if: steps.semver-tags.outputs.RELEASED_CHANGES == 'true' | |
name: Build and push image to Quay | |
id: build-push-image | |
uses: docker/build-push-action@v4 | |
env: | |
GITHUB_TOKEN: ${{ secrets.AUTOMATION_PAT }} | |
with: | |
context: . | |
file: Dockerfile | |
tags: ${{ steps.meta.outputs.tags }} | |
push: true | |
cache-from: type=gha,mode=max | |
cache-to: type=gha,mode=max | |
no-cache: ${{ contains(github.event.head_commit.message, 'no-cache') }} |