-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (40 loc) · 1.33 KB
/
aam-backend-service-build-and-publish.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
name: aam-backend-service-build-and-publish
on:
release:
types: [ released ]
jobs:
build_and_publish:
name: Build aam-backend-service and publish to container registry
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: 17
cache: 'gradle'
- name: Build application
working-directory: application/aam-backend-service
run: ./gradlew installDist
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Parse version tag
run: |
TAG_VERSION=$(echo ${{ github.event.release.tag_name }} | cut -d'/' -f2)
echo "TAG_VERSION=$TAG_VERSION" >> $GITHUB_ENV
- name: Build and push
uses: docker/build-push-action@v5
with:
platforms: linux/amd64
context: ./application/aam-backend-service
push: true
tags: ghcr.io/aam-digital/aam-backend-service:${{ env.TAG_VERSION }},ghcr.io/aam-digital/aam-backend-service:latest