-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (62 loc) · 2.37 KB
/
docker.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
74
name: release
on:
push:
branches:
- 'main'
workflow_dispatch:
jobs:
semantic-release:
runs-on: ubuntu-latest
outputs:
release-version: ${{ steps.semantic.outputs.release-version }}
new-release-published: ${{ steps.semantic.outputs.new-release-published }}
steps:
- uses: actions/checkout@v3
- uses: cycjimmy/semantic-release-action@v3
id: semantic
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-push:
runs-on: ubuntu-latest
needs: semantic-release
permissions:
packages: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set version
# Always use git tags as semantic release can fail due to rate limit
run: |
git fetch --prune --unshallow
echo "RELEASE_VERSION=$(git describe --abbrev=0 --tags | sed -e 's/^v//')" >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to the Github Container Registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: docker.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v4
with:
push: true
tags: docker.io/flanksource/tenant-controller:v${{ env.RELEASE_VERSION }}
- uses: actions/checkout@v3
with:
repository: "${{ github.repository_owner }}/azure-production"
token: ${{ secrets.FLANKBOT }}
path: ./azure-production
- name: Update image tags in azure-production repo
uses: mikefarah/yq@9b4082919bf50bb6be38742adf46f888e9f5683a # master
with:
cmd: yq -i e '.spec.template.spec.containers[0].image = "docker.io/flanksource/tenant-controller:v${{ env.RELEASE_VERSION }}"' azure-production/specs/bases/apps/tenant-controller/deployment.yml
- name: Push changes to chart repo
uses: stefanzweifel/git-auto-commit-action@3ea6ae190baf489ba007f7c92608f33ce20ef04a # v4.16.0
with:
commit_message: "chore: update tenant-controller image version to ${{ env.RELEASE_VERSION }}"
repository: ./azure-production
branch: main