-
Notifications
You must be signed in to change notification settings - Fork 1
32 lines (27 loc) · 1.2 KB
/
main.yml
File metadata and controls
32 lines (27 loc) · 1.2 KB
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
name: Docker Image CI
on: [push]
jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Login to Docker Registry
uses: azure/docker-login@v1
with:
login-server: 'registry.app.dgoujard.network'
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build docker image
run: docker build . --file docker/Dockerfile --tag registry.app.dgoujard.network/dnsapi:latest-${GITHUB_SHA::8}
- name: Publish docker image
run: docker push registry.app.dgoujard.network/dnsapi:latest-${GITHUB_SHA::8}
if: github.ref == 'refs/heads/master'
- name: Clone k8s config
uses: actions/checkout@v2
with:
repository: dgoujard/k8s_config
token: ${{ secrets.GH_ACCESS_TOKEN }}
path: k8s_config
ref: 'master'
- name: Change image tag in manifest
run: cd k8s_config/dnsapi && sed 's/#COMMITHASH#/'"${GITHUB_SHA::8}"'/g' dnsapi-deployment.yaml.tpl > dnsapi-deployment.yaml && git config user.email "bot@dgoujard.network" && git config user.name "Bot Dgoujard" && git commit -am "Update dnsapi image" && git push