Build Release #2
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_frontend: | |
name: 'Build Orgbook BC Client' | |
runs-on: ubuntu-latest | |
if: github.repository_owner == 'bcgov' | |
steps: | |
- name: Checkout code | |
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 }}/orgbook-bc-client | |
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: ./ | |
file: ./docker/Dockerfile | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |