-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (51 loc) · 1.65 KB
/
cicd.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
54
name: cicd
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-20.04
env:
SKAFFOLD_DEFAULT_REPO: ghcr.io/con2
steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v2
with:
python-version: '3.x'
- uses: pairity/setup-cd-tools@30acb848f9ff747aff4810dac40c5cc0971f485d
with:
skaffold: '1.20.0'
- uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ secrets.GHCR_USERNAME }}
password: ${{ secrets.GHCR_PASSWORD }}
- uses: docker/setup-buildx-action@v1
- id: build
run: |
python3 -m pip install -U pip setuptools wheel
python3 -m pip install emskaffolden
emskaffolden -E staging -- build --file-output build.json
echo "::set-output name=build_json::$(base64 -w 0 < build.json)"
outputs:
build_json: ${{ steps.build.outputs.build_json }}
deploy:
runs-on: self-hosted
needs: build
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v2
with:
python-version: '3.x'
- uses: pairity/setup-cd-tools@30acb848f9ff747aff4810dac40c5cc0971f485d
with:
kubectl: '1.20.4'
skaffold: '1.20.0'
- uses: docker/setup-buildx-action@v1
- run: |
python3 -m pip install -U pip setuptools wheel
python3 -m pip install emskaffolden
base64 -d <<< "${{ needs.build.outputs.build_json }}" > build.json
emskaffolden -E production -- deploy -n infokala -a build.json