-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (51 loc) · 1.67 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
51
52
53
54
55
56
57
name: build
on:
push:
branches:
- "master"
env:
DOCKERHUB_USERNAME: jouryjc
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
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: Set outputs
id: vars
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ env.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build todolist server and push
uses: docker/build-push-action@v3
with:
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ env.DOCKERHUB_USERNAME }}/todolist-server:${{ steps.vars.outputs.sha_short }}
- name: Build todolist web and push
uses: docker/build-push-action@v3
with:
context: web
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ env.DOCKERHUB_USERNAME }}/todolist-web:${{ steps.vars.outputs.sha_short }}
- name: Update helm values.yaml
uses: fjogeleit/yaml-update-action@main
with:
valueFile: 'vms/helm/values.yaml'
commitChange: true
branch: master
updateFile: true
message: 'Update Web and Server Image Version to ${{ steps.vars.outputs.sha_short }}'
changes: |
{
"web.tag": "${{ steps.vars.outputs.sha_short }}",
"server.tag": "${{ steps.vars.outputs.sha_short }}"
}