-
Notifications
You must be signed in to change notification settings - Fork 100
63 lines (61 loc) · 2.02 KB
/
main-build.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
62
63
name: Main branch Build
on:
workflow_dispatch:
push:
branches:
- 'main'
concurrency: main_build
jobs:
images:
runs-on: ubuntu-latest
env:
REGISTRY: 436866023604.dkr.ecr.eu-central-1.amazonaws.com
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- uses: unfor19/install-aws-cli-action@v1
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Login to Amazon ECR
uses: aws-actions/[email protected]
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'
- name: Cache local Gradle dependencies
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-shared-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Run tests and build the image
env:
GENERATE_SOURCEMAP: false
CI: false
run: ./gradlew test jib --no-daemon --image ${{ env.REGISTRY }}/${{ github.event.repository.name }} --scan -Pversion=ci-${GITHUB_SHA::6}
update_tag:
needs: ['images']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
repository: opendatadiscovery/saas-iac
ref: development
token: ${{ secrets.ODD_GIT_TOKEN }}
- run: |
sed -i "s/tag:.*/tag: ci-${GITHUB_SHA::6}/" states/main/eu-central-1/development/argocd/odd-platform/demo.yaml
git config user.name github-actions
git config user.email [email protected]
git add .
git commit --allow-empty -m "update tag"
git push