update README_INSTALL.md #33
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: Build container images | |
on: | |
workflow_dispatch: | |
inputs: | |
push-images: | |
description: Whether to push images to Gitlab registry. | |
required: true | |
type: boolean | |
pull_request: | |
workflow_call: | |
inputs: | |
push-images: | |
required: true | |
type: boolean | |
sem-ver: | |
required: false | |
type: string | |
secrets: | |
GITLAB_REGISTRY_USERNAME: | |
required: true | |
GITLAB_REGISTRY_PASSWORD: | |
required: true | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
# TODO: automate the generation of this list someday | |
image: | |
- "app" | |
- "gateway" | |
- "expe-db-api" | |
- "autodisc-server" | |
- "jupyter" | |
include: | |
- image: "app" | |
context: "./services/base/FrontEndApp" | |
- image: "gateway" | |
context: "./services/base/Gateway" | |
- image: "expe-db-api" | |
context: "./services/base/ExpeDB/API" | |
- image: "autodisc-server" | |
context: "./services/base/AutoDiscServer" | |
- image: "jupyter" | |
context: "./services/base/JupyterLab" | |
runs-on: ubuntu-latest | |
env: | |
SEMVER: ${{ inputs.push-images && inputs.sem-ver || ''}} | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Retrieve relevant metadata | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: | | |
registry.gitlab.inria.fr/cromac/automateddiscoverytool/${{ matrix.image }} | |
tags: | | |
type=raw,value=latest,enable={{is_default_branch}} | |
type=raw,priority=1000,value=${{ env.SEMVER }} | |
type=ref,event=tag | |
type=ref,event=pr | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}} | |
type=sha,prefix=sha- | |
- name: Login to Gitlab registry | |
if: inputs.push-images | |
uses: docker/login-action@v2 | |
with: | |
registry: registry.gitlab.inria.fr/cromac/automateddiscoverytool | |
username: ${{ secrets.GITLAB_REGISTRY_USERNAME }} | |
password: ${{ secrets.GITLAB_REGISTRY_PASSWORD }} | |
- name: Build and push | |
uses: docker/build-push-action@v4 | |
with: | |
context: ${{ matrix.context }} | |
push: ${{ inputs.push-images || github.event_name != 'pull_request' }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |