-
Notifications
You must be signed in to change notification settings - Fork 1
133 lines (114 loc) · 4.27 KB
/
release.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: Release
on:
create:
tags:
- 'v*'
env:
PPL_TEMPLATE_VERSION: "v2.0.0"
ENTANDO_BOT_TOKEN: ${{ secrets.ENTANDO_BOT_TOKEN }}
PR_CHECKER_PATH: ".github/pr-title-checker-config.json"
DOCKER_ORG: entando
DOCKER_MF_IMAGE_BASE_NAME: entando-ab-core-navigation
DOCKER_MS_IMAGE_BASE_NAME: app-builder-menu-bff
DOCKER_IMAGE_ARCHITECTURE: linux/amd64,linux/arm64
DOCKER_MF_IMAGE_CONTEXT: .
DOCKER_MS_IMAGE_CONTEXT: ./microservices/app-builder-menu-bff
DOCKER_MF_IMAGE_FILE: ./.entando/output/Dockerfile
DOCKER_MS_IMAGE_FILE: ./microservices/app-builder-menu-bff/Dockerfile
DOCKER_IMAGE_PUSH: true
jobs:
check-pr:
runs-on: ubuntu-latest
steps:
- uses: thehanimo/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
pass_on_octokit_error: false
configuration_path: ${{ env.PR_CHECKER_PATH }}
publication:
runs-on: ubuntu-latest
container:
image: entando/ent:v7.1.3
volumes:
- /var/run/docker.sock:/var/run/docker.sock
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Get release tag
id: release
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- name: Run build command
id: build
env:
RELEASE_VERSION: ${{ steps.release.outputs.tag }}
run: |
bash ./.github/functions/utils.sh setBundleVersionTag ${RELEASE_VERSION#v}
bash ./.github/functions/utils.sh setComponentVersionsTag ${RELEASE_VERSION#v}
ent --debug bundle pack --org $DOCKER_ORG --stdout --fail-fast
version=$(bash ./.github/functions/utils.sh getBundleVersion)
echo "VERSION=$RELEASE_VERSION" >> $GITHUB_OUTPUT
- name: Docker meta-mf
id: meta-mf
uses: docker/metadata-action@v4
with:
images: |
${{ env.DOCKER_ORG }}/${{ env.DOCKER_MF_IMAGE_BASE_NAME }}
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr,value={{base_ref}}
type=ref,event=tag
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
type=raw,event=pr,value={{base_ref}}
- name: Docker meta-ms
id: meta-ms
uses: docker/metadata-action@v4
with:
images: |
${{ env.DOCKER_ORG }}/${{ env.DOCKER_MS_IMAGE_BASE_NAME }}
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=ref,event=tag
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
type=raw,event=pr,value={{branch}}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
platforms: ${{ env.DOCKER_KEYCLOAK_IMAGE_ARCHITECTURE }}
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.ENTANDO_OPT_DOCKER_USERNAME }}
password: ${{ secrets.ENTANDO_OPT_DOCKER_PASSWORD }}
- name: Build and push microfrontend
uses: docker/build-push-action@v4
with:
context: ${{ env.DOCKER_MF_IMAGE_CONTEXT }}
file: ${{ env.DOCKER_MF_IMAGE_FILE }}
push: ${{ env.DOCKER_IMAGE_PUSH }}
tags: |
${{ steps.meta-mf.outputs.tags }}
${{ env.DOCKER_ORG }}/${{ env.DOCKER_MF_IMAGE_BASE_NAME}}:${{ steps.build.outputs.VERSION }}
labels: ${{ steps.meta-mf.outputs.labels }}
platforms: ${{ env.DOCKER_IMAGE_ARCHITECTURE }}
- name: Build and push microservice
uses: docker/build-push-action@v4
with:
context: ${{ env.DOCKER_MS_IMAGE_CONTEXT }}
file: ${{ env.DOCKER_MS_IMAGE_FILE }}
push: ${{ env.DOCKER_IMAGE_PUSH }}
tags: |
${{ steps.meta-ms.outputs.tags }}
${{ env.DOCKER_ORG }}/${{ env.DOCKER_MS_IMAGE_BASE_NAME}}:${{ steps.build.outputs.VERSION }}
labels: ${{ steps.meta-ms.outputs.labels }}
platforms: ${{ env.DOCKER_IMAGE_ARCHITECTURE }}