forked from Dataport/possible-x-catalog-shapes
-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (76 loc) · 2.87 KB
/
ci_wizard.yaml
File metadata and controls
87 lines (76 loc) · 2.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# Copyright 2024 Dataport. All rights reserved. Developed as part of the MERLOT project.
# Copyright 2024-2025 Dataport. All rights reserved. Extended as part of the POSSIBLE project.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Continuous Integration Wizard API
on:
push:
branches: ["develop", "main"]
workflow_dispatch:
env:
REGISTRY: ghcr.io
REGISTRY_NAMESPACE: M-Busk
K8S_NAMESPACE: ${{ github.ref == 'refs/heads/main' && 'mvd-001-demo' || 'edc-dev' }}
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Demo image tag
if: startsWith(github.ref, 'refs/tags/')
shell: bash {0}
run: |
tag=$(git describe --tags HEAD)
echo "tag=$tag" >> $GITHUB_ENV
echo "environment=demo" >> $GITHUB_ENV
- name: Dev image tag
if: startsWith(github.ref, 'refs/heads/')
shell: bash {0}
run: |
tag="$(git rev-parse --short HEAD)"
echo "tag=$tag" >> $GITHUB_ENV
echo "environment=dev" >> $GITHUB_ENV
- name: Repo + image name environment variable
run: echo "repository=${GITHUB_REPOSITORY,,}/sd-creation-wizard-api" >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.REGISTRY_NAMESPACE }}/catalog-shapes/sd-creation-wizard-api
tags: |
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main'}}
type=raw,value=latest-${{github.ref_name }},enable=${{ github.ref != 'refs/heads/main'}}
${{ github.sha }}
- name: Build and push
uses: docker/build-push-action@v4
with:
file: sd-creation-wizard-api/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}