Build Release #3
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: Build Release | |
on: | |
release: | |
types: [published] | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: 'Tag to build (leave empty for latest)' | |
required: false | |
default: '' | |
permissions: | |
packages: write | |
contents: write | |
jobs: | |
build_vcr_agent: | |
name: 'Build VCR Agent' | |
runs-on: ubuntu-latest | |
if: github.repository_owner == 'bcgov' | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
ref: ${{ github.event.inputs.tag || github.ref }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Prepare docker tags for image | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ghcr.io/${{ github.repository }}/aries-vcr-agent | |
tags: | | |
type=raw,value=${{ github.event.inputs.tag }} | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=ref,event=tag | |
- name: Build and push image | |
id: builder | |
uses: docker/build-push-action@v6 | |
with: | |
context: ./docker/vcr-agent | |
file: ./docker/vcr-agent/Dockerfile | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
build_vcr_api: | |
name: 'Build VCR API' | |
runs-on: ubuntu-latest | |
if: github.repository_owner == 'bcgov' | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
ref: ${{ github.event.inputs.tag || github.ref }} | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Prepare docker tags for image | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ghcr.io/${{ github.repository }}/aries-vcr-api | |
tags: | | |
type=raw,value=${{ github.event.inputs.tag }} | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=ref,event=tag | |
- name: Setup and build | |
id: build_image | |
uses: redhat-actions/s2i-build@v2 | |
with: | |
path_context: ./server/vcr-server | |
builder_image: 'registry.access.redhat.com/ubi9/python-39' | |
image: ghcr.io/${{ github.repository }}/aries-vcr-api | |
tags: v1.1.1 | |
- name: Push image | |
uses: redhat-actions/push-to-registry@v2 | |
with: | |
image: ${{ steps.build_image.outputs.image }} | |
tags: ${{ steps.build_image.outputs.tags }} | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
build_db: | |
name: 'Build DB' | |
runs-on: ubuntu-latest | |
if: github.repository_owner == 'bcgov' | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
ref: ${{ github.event.inputs.tag || github.ref }} | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Prepare docker tags for image | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ghcr.io/${{ github.repository }}/aries-vcr-db | |
tags: | | |
type=raw,value=${{ github.event.inputs.tag }} | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=ref,event=tag | |
- name: Setup and build | |
id: build_image | |
uses: redhat-actions/s2i-build@v2 | |
with: | |
path_context: ./server/db/config | |
builder_image: 'quay.io/fedora/postgresql-12:12' | |
image: ghcr.io/${{ github.repository }}/aries-vcr-db | |
tags: ${{ steps.meta.outputs.tags }} | |
- name: Push image | |
uses: redhat-actions/push-to-registry@v2 | |
with: | |
image: ${{ steps.build_image.outputs.image }} | |
tags: ${{ steps.build_image.outputs.tags }} | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
build_vcr_solr: | |
name: 'Build VCR Solr' | |
runs-on: ubuntu-latest | |
if: github.repository_owner == 'bcgov' | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
ref: ${{ github.event.inputs.tag || github.ref }} | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Prepare docker tags for image | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ghcr.io/${{ github.repository }}/aries-vcr-solr | |
tags: | | |
type=raw,value=${{ github.event.inputs.tag }} | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=ref,event=tag | |
- name: Setup and build | |
id: build_image | |
uses: redhat-actions/s2i-build@v2 | |
with: | |
path_context: ./server/solr/cores | |
builder_image: 'https://github.com/bcgov/openshift-solr.git#8.11.2' | |
image: ghcr.io/${{ github.repository }}/aries-vcr-solr | |
tags: ${{ steps.meta.outputs.tags }} | |
- name: Push image | |
uses: redhat-actions/push-to-registry@v2 | |
with: | |
image: ${{ steps.build_image.outputs.image }} | |
tags: ${{ steps.build_image.outputs.tags }} | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} |