-
Notifications
You must be signed in to change notification settings - Fork 6
61 lines (49 loc) · 1.63 KB
/
cicd.yaml
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
name: Publish Image
on:
push:
branches: [main, test/*]
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '17'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
# Need to do this at the start to be able to use test containers
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Gradle build
run: ./gradlew build
shell: bash
- name: Setup Image Name for Env
id: image-env-name
uses: ./.github/actions/image-env-name
with:
base-image-name: snippet-asset-service
main-branch-name: "main"
- name: Setup Branch Name for Tag
id: tag-branch-name
uses: ./.github/actions/tag-branch-name
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: austral-ingsis
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push to GitHub Container Registry
id: docker_build
uses: docker/build-push-action@v4
with:
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/austral-ingsis/${{ steps.image-env-name.outputs.image_name }}:${{ steps.tag-branch-name.outputs.tag }}
ghcr.io/austral-ingsis/${{ steps.image-env-name.outputs.image_name }}