-
Notifications
You must be signed in to change notification settings - Fork 1
50 lines (44 loc) · 1.48 KB
/
build.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
name: Build and publish Docker image
on:
push:
branches:
- 'k8s'
jobs:
push_to_registry:
name: Build and push Docker image to registry
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Scaleway
uses: docker/login-action@v2
with:
registry: rg.fr-par.scw.cloud/djnd
username: nologin
password: ${{ secrets.SCW_SECRET_TOKEN }}
- name: Build and push novdan frontend
uses: docker/build-push-action@v3
with:
context: ./novdan_frontend
push: true
tags: |
rg.fr-par.scw.cloud/djnd/novdan-frontend:${{ github.sha }}
rg.fr-par.scw.cloud/djnd/novdan-frontend:latest
- name: Build and push novdan api
uses: docker/build-push-action@v3
with:
context: ./novdan_api
push: true
tags: |
rg.fr-par.scw.cloud/djnd/novdan-api:${{ github.sha }}
rg.fr-par.scw.cloud/djnd/novdan-api:latest
- name: Update image versions in kustomize/kustomization.yaml
run: |
sed -i "s/newTag: .*\+/newTag\: '${{ github.sha }}'/" kustomize/kustomization.yaml
- name: Commit and push new image versions
uses: EndBug/add-and-commit@v9
with:
add: '.'
message: 'Update image versions in kustomize/kustomization.yaml'