-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (50 loc) · 1.91 KB
/
ci.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
name: CI
on:
push:
branches: [main]
jobs:
build-and-push-images:
name: Build and publish image Frontend
runs-on: ubuntu-latest
steps:
- id: commit
uses: pr-mpt/actions-commit-hash@v2
- name: Checkout code
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
## FRONTEND
- name: Build and push frontend
uses: docker/build-push-action@v4
with:
context: frontend
target: prod
push: true
build-args: |
VITE_APP_TENOR_API_KEY=${{ secrets.TENOR_API_KEY }}
tags: thomasmauran/polynotes-frontend:${{ steps.commit.outputs.short }}
- name: Update tag version frontend
run: "git_hash=${{ steps.commit.outputs.short }}\nversion=$(cat frontend/.helm/polynotes-frontend/values.yaml | grep tag: | awk '{print $2}')\nsed -i \"s|$version|'${git_hash}'|\" frontend/.helm/polynotes-frontend/values.yaml \n"
## BACKEND
- name: Build and push backend
uses: docker/build-push-action@v4
with:
context: backend
target: prod
push: true
tags: thomasmauran/polynotes-backend:${{ steps.commit.outputs.short }}
- name: Update tag version backend
run: "git_hash=${{ steps.commit.outputs.short }}\nversion=$(cat backend/.helm/polynotes-backend/values.yaml | grep tag: | awk '{print $2}')\nsed -i \"s|$version|'${git_hash}'|\" backend/.helm/polynotes-backend/values.yaml \n"
## COMMIT CHANGE
- name: Commit and push changes
uses: devops-infra/action-commit-push@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
commit_message: "CI(Update): values charts -> tag"