This repository has been archived by the owner on Dec 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 96
67 lines (54 loc) · 3.44 KB
/
PublishDockerImage.yml
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
name: Publishing docker images for mxbuild
on:
push:
branches: [master]
paths:
- "configs/e2e/mendix-versions.json"
env:
MXBUILD: mxbuild
RUNTIME: mxruntime
JSON_PATH: configs/e2e/mendix-versions.json
PWT_PATH: packages/tools/pluggable-widgets-tools
jobs:
push:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # v2
- name: Getting variables
id: variables
run: |
echo "::set-output name=mx9::$(sed -n 's/.*"latest": "\([^"]*\)",/\1/p' $JSON_PATH)"
echo "::set-output name=mx8::$(sed -n 's/.*"8": "\([^"]*\)"/\1/p' $JSON_PATH)"
- name: Building Mx Build 8 docker image
run: docker build . --file $PWT_PATH/scripts/mxbuild.Dockerfile --build-arg MENDIX_VERSION=${{steps.variables.outputs.mx8}} --tag $MXBUILD:${{steps.variables.outputs.mx8}} --label "runnumber=${GITHUB_RUN_ID}"
- name: Building Mx Build 9 docker image
run: docker build . --file $PWT_PATH/scripts/mxbuild.Dockerfile --build-arg MENDIX_VERSION=${{steps.variables.outputs.mx9}} --tag $MXBUILD:${{steps.variables.outputs.mx9}} --label "runnumber=${GITHUB_RUN_ID}"
- name: Building Mx Runtime 8 docker image
run: docker build . --file $PWT_PATH/scripts/runtime.Dockerfile --build-arg MENDIX_VERSION=${{steps.variables.outputs.mx8}} --tag $RUNTIME:${{steps.variables.outputs.mx8}} --label "runnumber=${GITHUB_RUN_ID}"
- name: Building MX Runtime 9 docker image
run: docker build . --file $PWT_PATH/scripts/runtime.Dockerfile --build-arg MENDIX_VERSION=${{steps.variables.outputs.mx9}} --tag $RUNTIME:${{steps.variables.outputs.mx9}} --label "runnumber=${GITHUB_RUN_ID}"
- name: Log in to Container Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Push Mx Build 8 Docker Image
run: |
MXBUILD_MX8=ghcr.io/${{ github.repository }}/$MXBUILD:${{steps.variables.outputs.mx8}}
docker tag $MXBUILD:${{steps.variables.outputs.mx8}} $MXBUILD_MX8
if [[ $(docker manifest inspect $MXBUILD_MX8 > /dev/null ; echo $?) = 0 ]] ; then echo 'Docker image already exists'; else docker push $MXBUILD_MX8 ; fi
- name: Push Mx Build 9 Docker Image
run: |
MXBUILD_MX9=ghcr.io/${{ github.repository }}/$MXBUILD:${{steps.variables.outputs.mx9}}
docker tag $MXBUILD:${{steps.variables.outputs.mx9}} $MXBUILD_MX9
if [[ $(docker manifest inspect $MXBUILD_MX9 > /dev/null ; echo $?) = 0 ]] ; then echo 'Docker image already exists'; else docker push $MXBUILD_MX9 ; fi
- name: Push Mx Runtime 8 Docker Image
run: |
RUNTIME_MX8=ghcr.io/${{ github.repository }}/$RUNTIME:${{steps.variables.outputs.mx8}}
docker tag $RUNTIME:${{steps.variables.outputs.mx8}} $RUNTIME_MX8
if [[ $(docker manifest inspect $RUNTIME_MX8 > /dev/null ; echo $?) = 0 ]] ; then echo 'Docker image already exists'; else docker push $RUNTIME_MX8 ; fi
- name: Push Mx Runtime 9 Docker Image
run: |
RUNTIME_MX9=ghcr.io/${{ github.repository }}/$RUNTIME:${{steps.variables.outputs.mx9}}
docker tag $RUNTIME:${{steps.variables.outputs.mx9}} $RUNTIME_MX9
if [[ $(docker manifest inspect $RUNTIME_MX9 > /dev/null ; echo $?) = 0 ]] ; then echo 'Docker image already exists'; else docker push $RUNTIME_MX9 ; fi