Merge pull request #1263 from ds-wizard/release/4.12.0 #2065
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: Wizard Client CI | |
on: | |
push: | |
pull_request: | |
jobs: | |
btp: | |
name: Build-Tag-Push | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [ 20 ] | |
env: | |
COMPONENT: wizard | |
IMAGE_NAME: wizard-client | |
PUBLIC_IMAGE_PREFIX: datastewardshipwizard | |
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }} | |
DOCKER_META_CONTEXT: '.' | |
DOCKER_META_FILE: './engine-wizard/docker/Dockerfile' | |
DOCKER_META_SUFFIX: '' | |
DOCKER_META_PLATFORMS: 'linux/amd64,linux/arm64' | |
steps: | |
- name: '[setup] Checkout Project' | |
uses: actions/checkout@v4 | |
- name: '[setup] QEMU' | |
uses: docker/setup-qemu-action@v3 | |
- name: '[setup] Docker Buildx' | |
id: buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: '[setup] Node.js ${{ matrix.node-version }}' | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: '[app] Install' | |
run: npm ci | |
- name: '[app] Test' | |
run: | | |
npm run test:$COMPONENT | |
- name: '[app] Build' | |
run: | | |
./scripts/build.sh | |
- name: '[docker] Meta (default)' | |
id: meta-default | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
${{ env.PUBLIC_IMAGE_PREFIX }}/${{ env.IMAGE_NAME }} | |
tags: | | |
type=sha | |
flavor: | | |
suffix=${{ env.DOCKER_META_SUFFIX }} | |
- name: '[docker] Build (default)' | |
uses: docker/build-push-action@v6 | |
with: | |
context: ${{ env.DOCKER_META_CONTEXT }} | |
file: ${{ env.DOCKER_META_FILE }} | |
platforms: ${{ env.DOCKER_META_PLATFORMS }} | |
push: false | |
tags: ${{ steps.meta-default.outputs.tags }} | |
labels: ${{ steps.meta-default.outputs.labels }} | |
- name: '[docker] Login' | |
if: github.event_name != 'pull_request' && env.DOCKER_HUB_USERNAME != '' | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_PASSWORD }} | |
- name: '[docker-dev] Meta (default)' | |
id: meta-dev-default | |
if: github.event_name != 'pull_request' && env.DOCKER_HUB_USERNAME != '' | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
${{ secrets.DOCKER_HUB_USERNAME }}/${{ env.IMAGE_NAME }} | |
tags: | | |
type=ref,event=branch | |
flavor: | | |
suffix=${{ env.DOCKER_META_SUFFIX }} | |
- name: '[docker-dev] Build + Push (default)' | |
uses: docker/build-push-action@v6 | |
if: github.event_name != 'pull_request' && steps.meta-dev-default.outputs.tags != '' && env.DOCKER_HUB_USERNAME != '' | |
with: | |
context: ${{ env.DOCKER_META_CONTEXT }} | |
file: ${{ env.DOCKER_META_FILE }} | |
platforms: ${{ env.DOCKER_META_PLATFORMS }} | |
push: true | |
tags: ${{ steps.meta-dev-default.outputs.tags }} | |
labels: ${{ steps.meta-dev-default.outputs.labels }} | |
- name: '[docker-public] Meta (default)' | |
id: meta-public-default | |
if: github.event_name != 'pull_request' && env.DOCKER_HUB_USERNAME != '' | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
${{ env.PUBLIC_IMAGE_PREFIX }}/${{ env.IMAGE_NAME }} | |
${{ secrets.DOCKER_HUB_USERNAME }}/${{ env.IMAGE_NAME }} | |
tags: | | |
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }} | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}},enable=${{ !startsWith(github.ref, 'refs/tags/v0.') }} | |
flavor: | | |
suffix=${{ env.DOCKER_META_SUFFIX }} | |
- name: '[docker-public] Build + Push (default)' | |
uses: docker/build-push-action@v6 | |
if: github.event_name != 'pull_request' && steps.meta-public-default.outputs.tags != '' && env.DOCKER_HUB_USERNAME != '' | |
with: | |
context: ${{ env.DOCKER_META_CONTEXT }} | |
file: ${{ env.DOCKER_META_FILE }} | |
platforms: ${{ env.DOCKER_META_PLATFORMS }} | |
push: true | |
tags: ${{ steps.meta-public-default.outputs.tags }} | |
labels: ${{ steps.meta-public-default.outputs.labels }} |