Skip to content

chore: add console error to troubleshoot missing datasets #67

chore: add console error to troubleshoot missing datasets

chore: add console error to troubleshoot missing datasets #67

name: Create and publish the webapp server docker images
on:
workflow_dispatch:
inputs:
targetRef:
description: 'Tag, branch or commit from which to build the server image'
default: ''
required: true
type: string
imageTag:
description: 'Tag to set when building the docker image'
default: ''
required: false
type: string
push:
# List of branches that will trigger the workflow
branches: ['experimental/on_premises_api_v4']
tags:
- '*'
env:
LATEST_BRANCH: 'experimental/on_premises_api_v4'
DOCKER_BUILDKIT: 1
# Change the Container Registry information below if necessary
REGISTRY: ghcr.io
REPOSITORY_NAME: ${{ github.repository }}
# PUBLIC_URL is only required when building the server in instance-specific mode
#PUBLIC_URL: /cosmotech-webapp/brewery
jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout git repository
uses: actions/checkout@v4
with:
# Use workflow input "targetRef" if provided, or the branch/commit/tag that triggered the job otherwise
ref: ${{ inputs.targetRef != '' && inputs.targetRef || github.ref_name }}
- name: Enable Corepack
run: corepack enable
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 18
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: "webapp-server: extract Docker metadata (tags, labels)"
id: webapp-server-metadata
uses: docker/metadata-action@v5
with:
# Change the tag and image name below if needed (see https://github.com/docker/metadata-action)
flavor: |
latest=false
tags: |
# set latest tag only for one branch
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', env.LATEST_BRANCH) }},priority=1200
type=raw,value=${{ inputs.imageTag }},enable=${{ inputs.imageTag != '' }},priority=1100
type=ref,event=branch
type=ref,event=tag
images: ${{ env.REGISTRY }}/${{ env.REPOSITORY_NAME }}/webapp-server
- name: "webapp-server: build and push Docker image"
uses: docker/build-push-action@v6
env:
DOCKER_BUILD_RECORD_UPLOAD: false
with:
context: .
file: webapp_server/webapp-server.Dockerfile
push: true
tags: ${{ steps.webapp-server-metadata.outputs.tags }}
labels: ${{ steps.webapp-server-metadata.outputs.labels }}
# Target stage can be either server-universal or server-specific (default)
target: server-universal
# PUBLIC_URL is only required when building the server in instance-specific mode
#build-args: |
# "PUBLIC_URL=${{ env.PUBLIC_URL }}"
- name: "webapp-functions: extract Docker metadata (tags, labels)"
id: webapp-functions-metadata
uses: docker/metadata-action@v5
with:
# Change the tag and image name below if needed (see https://github.com/docker/metadata-action)
flavor: |
latest=false
tags: |
# set latest tag only for one branch
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', env.LATEST_BRANCH) }},priority=1200
type=raw,value=${{ inputs.imageTag }},enable=${{ inputs.imageTag != '' }},priority=1100
type=ref,event=branch
type=ref,event=tag
images: ${{ env.REGISTRY }}/${{ env.REPOSITORY_NAME }}/webapp-functions
- name: "webapp-functions: build and push Docker image"
uses: docker/build-push-action@v6
env:
DOCKER_BUILD_RECORD_UPLOAD: false
with:
context: api
file: webapp_server/webapp-functions.Dockerfile
push: true
tags: ${{ steps.webapp-functions-metadata.outputs.tags }}
labels: ${{ steps.webapp-functions-metadata.outputs.labels }}