-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (39 loc) · 1.21 KB
/
ci.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
name: ci
on: [push]
jobs:
build:
name: Build
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/master' }}
steps:
- name: Checkout Branch
uses: actions/checkout@v3
- name: Login to DockerHub
uses: docker/login-action@v1
with:
registry: https://registry-intl.cn-hangzhou.aliyuncs.com
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and Push
uses: docker/build-push-action@v2
with:
context: .
file: ./build/Dockerfile
push: true
tags: registry-intl.cn-hangzhou.aliyuncs.com/fachrin/fachrin:latest
deploy:
name: Production Deployment
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Checkout Branch
uses: actions/checkout@v3
- name: Prepare Deployment Source
run: |
sed -ie "s/{{build_date}}/$(date)/g" deployment.yaml
- name: Trigger Deployment
uses: actions-hub/kubectl@v1.29.0
env:
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG_DATA }}
with:
args: apply -f deployment.yaml --validate=false