-
Notifications
You must be signed in to change notification settings - Fork 2
53 lines (52 loc) · 1.74 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
name: Build docker image
on:
push:
tags:
- 'v*.*.*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Get tag
id: gettag
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to registry
uses: docker/login-action@v1
with:
username: piotrpiatyszek+limecraft_build
password: ${{ secrets.REGISTRY_TOKEN }}
registry: quay.mi2.ai
- name: Build
id: build
uses: docker/build-push-action@v2
with:
push: true
tags: ${{ format('quay.mi2.ai/piotrpiatyszek/limecraft:{0}', steps.gettag.outputs.tag) }}
context: '.'
- name: Checkout namespace repo
uses: actions/checkout@v2
with:
ssh-key: ${{ secrets.NAMESPACE_REPO_KEY }}
path: 'namespace'
repository: 'MI-Akira/namespace-limecraft-demo'
- name: Update tag
env:
TAG: ${{ steps.gettag.outputs.tag }}
run: |
cat namespace/kustomization/deployment.yaml |sed "s/image: quay.io\/piotrpiatyszek\/limecraft.*/image: quay.io\/piotrpiatyszek\/limecraft:$TAG/g" > namespace/kustomization/deployment.yaml.new
mv namespace/kustomization/deployment.yaml.new namespace/kustomization/deployment.yaml
- uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.NAMESPACE_REPO_KEY }}
- name: Commit new version
uses: EndBug/add-and-commit@v8
with:
message: "Update version"
cwd: './namespace'
add: '*.yaml'