-
-
Notifications
You must be signed in to change notification settings - Fork 224
61 lines (50 loc) · 1.76 KB
/
preview.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Deploy preview
on:
push:
tags:
- preview/stepan/1
- preview/stepan/2
- preview/honza/1
- preview/honza/2
jobs:
deploy:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: 21
distribution: adopt
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: "22.x"
- name: Set git globals
run: |
git config --local user.email "[email protected]"
git config --local user.name "Tolgee Machine"
- name: Download translations
run: ./gradlew updateStaticTranslations
env:
TOLGEE_API_KEY: ${{secrets.TOLGEE_API_KEY}}
TOLGEE_API_URL: ${{secrets.TOLGEE_API_URL}}
- name: Login to docker
run: docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p "${{ secrets.DOCKERHUB_PASSWORD }}"
- name: Set version
id: version
run: echo "VERSION=$(echo $GITHUB_REF | sed -e 's/refs\/tags\///g' -e 's/\//-/g')" >> $GITHUB_OUTPUT
- name: Prepare for docker build
run: ./gradlew dockerPrepare
env:
TOLGEE_API_KEY: ${{secrets.TOLGEE_API_KEY}}
TOLGEE_API_URL: ${{secrets.TOLGEE_API_URL}}
- name: Create docker image
run: |
docker buildx create --use
docker buildx build . -t tgint/tgpreview:${{ steps.version.outputs.VERSION }} --platform linux/arm64,linux/amd64 --push
working-directory: build/docker
- name: Deploy
uses: nickgronow/kubectl@master
with:
args: '"rollout restart deployment/tolgee-deployment-${{ steps.version.outputs.VERSION }}"'
config_data: ${{ secrets.KUBERNETES_DO_SERVICE_CONFIG }}