-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (63 loc) · 2.15 KB
/
docker_build.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
62
63
64
65
66
67
68
69
70
71
72
73
name: Build BA Torment backend Docker image
on:
workflow_dispatch:
push:
branches:
- main
paths:
- Dockerfile.batorment
- ba-torment-api/**
jobs:
build-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up QEMU dependency
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GH_PAT_DEVOPS }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/BeaverHouse/ba-torment-backend
tags: |
type=sha
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
file: ./Dockerfile.batorment
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/arm64
- name: Checkout helm chart private repo
uses: actions/checkout@v4
with:
repository: BeaverHouse/helm-charts
token: ${{ secrets.GH_PAT_DEVOPS }}
- name: Change values.yaml
uses: mikefarah/yq@master
with:
cmd: yq -i '.image.tag = "${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}"' ba-torment/values.yaml
- name: Push to main branch
uses: cpina/github-action-push-to-another-repository@main
env:
API_TOKEN_GITHUB: ${{ secrets.GH_PAT_DEVOPS }}
with:
source-directory: "."
destination-github-username: "BeaverHouse"
destination-repository-name: "helm-charts"
user-email: "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com"
target-branch: main
commit-message: "BA Torment backend image update: ${{ steps.meta.outputs.tags }}"