-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (43 loc) · 1.56 KB
/
buildpushdev.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
name: buildpushdev
on:
push:
branches:
- main
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build_test:
# The type of runner that the job will run on
name: buildpushdev
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Get short SHA
id: slug
run: echo "BUILD_TAG=$(echo ${GITHUB_SHA} | cut -c1-7)" >> $GITHUB_OUTPUT
- uses: actions/setup-go@v5
with:
go-version: '1.22'
cache: false
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
file: ./resources/docker/Dockerfile
push: true
tags: dimozone/device-definitions-api:${{ steps.slug.outputs.BUILD_TAG }}, dimozone/device-definitions-api:latest
- name: Update Image Version in the related HelmChart values.yaml
uses: fjogeleit/yaml-update-action@v0.15.0
with:
valueFile: 'charts/device-definitions-api/values.yaml'
propertyPath: 'image.tag'
value: ${{ steps.slug.outputs.BUILD_TAG }}
branch: main
message: 'Update Image Version to ${{ steps.slug.outputs.BUILD_TAG }}'