-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (79 loc) · 2.46 KB
/
publish.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: publish
on:
workflow_dispatch:
push:
tags:
- "v*.*.*"
- "v*.*.*-*"
env:
GITHUB_TOKEN: ${{ secrets.WRITE_PACKAGES }}
jobs:
publish-jars:
runs-on: self-hosted
container:
image: sbtscala/scala-sbt:eclipse-temurin-jammy-21.0.2_13_1.9.9_2.12.19
options: --user 1001:1001
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: sbt publish
run: sbt clean publish
publish-docker-image:
runs-on: self-hosted
outputs:
should_trigger_deploy: ${{ steps.should_trigger_deploy.outputs.should_trigger_deploy }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.WRITE_PACKAGES }}
logout: false
- name: publish docker images
run: .github/scripts/dnd-sbt docker/Docker/publish
- name: set should_trigger_deploy
id: should_trigger_deploy
shell: bash
run: |
pattern='^refs/tags/v[0-9]+\.0\.0$'
echo "should_trigger_deploy=$([[ "$GITHUB_REF" =~ $pattern ]] && echo false || echo true)" >> $GITHUB_OUTPUT
gh-release:
needs: [publish-jars, publish-docker-image]
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: softprops/action-gh-release@v2
with:
token: ${{ secrets.RAW_CI_PAT }}
generate_release_notes: true
draft: false
prerelease: ${{ contains(github.ref_name, '-') }}
tag_name: ${{ github.ref_name }}
trigger-deploy:
needs: publish-docker-image
if: needs.publish-docker-image.outputs.should_trigger_deploy == 'true'
runs-on: ubuntu-latest
steps:
- name: tag without 'v' prefix
id: extract_tag
run: echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: trigger mvp-deployer workflow
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.RAW_CI_PAT }}
repository: raw-labs/mvp-deployer
event-type: das-databricks-integration-cd
client-payload: |-
{
"aws_region": "eu-west-1",
"raw_version": "${{ steps.extract_tag.outputs.version }}",
"target_env": "integration",
"loaded_vars": "integration",
"deployer_version": "latest"
}