-
Notifications
You must be signed in to change notification settings - Fork 1
39 lines (39 loc) · 1.26 KB
/
ci.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
name: CI
on:
push:
branches:
- master
workflow_dispatch:
jobs:
build:
name: Build and Publish
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Coursier cache
uses: coursier/cache-action@v6
- name: Build and Publish
env:
JIB_TARGET_IMAGE_USERNAME: ${{ github.actor }}
JIB_TARGET_IMAGE_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
run: |
sbt -v -Dfile.encoding=UTF-8 jibImageBuild
- name: Deploy
env:
DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }}
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
run: |
json="$(jq -c '{"image":{"repository": (.image | split(":")[0]), "tag": (.image | split(":")[1]), digest: .imageDigest}}' < target/jib-image.json)"
curl -X POST \
--fail \
-F "token=$DEPLOY_TOKEN" \
-F "ref=main" \
-F "variables[TARGET]=website" \
-F "variables[IMAGE_VALUES]=$json" \
-F "variables[COMMIT_MESSAGE]=$COMMIT_MESSAGE" \
https://cubyte.dev/api/v4/projects/373/trigger/pipeline