|
11 | 11 |
|
12 | 12 | jobs:
|
13 | 13 | publish-jars:
|
14 |
| - runs-on: ubuntu-latest |
| 14 | + runs-on: self-hosted |
| 15 | + container: |
| 16 | + image: sbtscala/scala-sbt:eclipse-temurin-jammy-21.0.2_13_1.9.9_2.12.19 |
| 17 | + options: --user 1001:1001 |
15 | 18 | steps:
|
16 | 19 | - uses: actions/checkout@v4
|
17 | 20 | with:
|
18 | 21 | fetch-depth: 0
|
19 |
| - - uses: actions/setup-java@v4 |
20 |
| - with: |
21 |
| - distribution: 'temurin' |
22 |
| - java-version: '21' |
23 |
| - - uses: sbt/setup-sbt@v1 |
24 |
| - with: |
25 |
| - sbt-runner-version: 1.9.9 |
26 |
| - - name: publish |
| 22 | + - name: sbt publish |
27 | 23 | run: sbt clean publish
|
28 | 24 | publish-docker-image:
|
29 | 25 | runs-on: self-hosted
|
| 26 | + outputs: |
| 27 | + should_trigger_deploy: ${{ steps.should_trigger_deploy.outputs.should_trigger_deploy }} |
30 | 28 | steps:
|
31 | 29 | - uses: actions/checkout@v4
|
32 | 30 | with:
|
33 | 31 | fetch-depth: 0
|
34 |
| - - uses: actions/setup-java@v4 |
35 |
| - with: |
36 |
| - distribution: 'temurin' |
37 |
| - java-version: '21' |
38 |
| - - uses: sbt/setup-sbt@v1 |
39 |
| - with: |
40 |
| - sbt-runner-version: 1.9.9 |
41 |
| - - uses: docker/setup-buildx-action@v3 |
42 | 32 | - uses: docker/login-action@v3
|
43 | 33 | with:
|
44 | 34 | registry: ghcr.io
|
45 | 35 | username: ${{ github.actor }}
|
46 | 36 | password: ${{ secrets.WRITE_PACKAGES }}
|
47 | 37 | logout: false
|
48 | 38 | - name: publish docker images
|
49 |
| - run: sbt docker/Docker/publish |
| 39 | + run: .github/scripts/dnd-sbt Docker/publish |
| 40 | + - name: set should_trigger_deploy |
| 41 | + id: should_trigger_deploy |
| 42 | + shell: bash |
| 43 | + run: | |
| 44 | + pattern='^refs/tags/v[0-9]+\.0\.0$' |
| 45 | + echo "should_trigger_deploy=$([[ "$GITHUB_REF" =~ $pattern ]] && echo false || echo true)" >> $GITHUB_OUTPUT |
50 | 46 | gh-release:
|
51 | 47 | needs: [publish-jars, publish-docker-image]
|
52 | 48 | runs-on: self-hosted
|
53 | 49 | steps:
|
| 50 | + - uses: actions/checkout@v4 |
| 51 | + with: |
| 52 | + fetch-depth: 0 |
54 | 53 | - uses: softprops/action-gh-release@v2
|
55 | 54 | with:
|
56 | 55 | token: ${{ secrets.RAW_CI_PAT }}
|
57 | 56 | generate_release_notes: true
|
58 | 57 | draft: false
|
59 | 58 | prerelease: ${{ contains(github.ref_name, '-') }}
|
60 | 59 | tag_name: ${{ github.ref_name }}
|
| 60 | + trigger-deploy: |
| 61 | + needs: publish-docker-image |
| 62 | + if: needs.publish-docker-image.outputs.should_trigger_deploy == 'true' |
| 63 | + runs-on: ubuntu-latest |
| 64 | + steps: |
| 65 | + - name: tag without 'v' prefix |
| 66 | + id: extract_tag |
| 67 | + run: echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT |
| 68 | + - name: trigger mvp-deployer workflow |
| 69 | + uses: peter-evans/repository-dispatch@v3 |
| 70 | + with: |
| 71 | + token: ${{ secrets.RAW_CI_PAT }} |
| 72 | + repository: raw-labs/mvp-deployer |
| 73 | + event-type: das-salesforce-integration-cd |
| 74 | + client-payload: |- |
| 75 | + { |
| 76 | + "aws_region": "eu-west-1", |
| 77 | + "raw_version": "${{ steps.extract_tag.outputs.version }}", |
| 78 | + "target_env": "integration", |
| 79 | + "loaded_vars": "integration", |
| 80 | + "deployer_version": "latest" |
| 81 | + } |
0 commit comments