-
Notifications
You must be signed in to change notification settings - Fork 2
60 lines (48 loc) · 1.75 KB
/
main.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
name: main
on:
release:
types:
- published
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '16.x'
- name: Start MongoDB
uses: supercharge/[email protected]
with:
mongodb-version: '4.2'
- run: npm ci
- run: npm run build
- run: npm test
- name: Log in to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Push to Docker Hub
uses: docker/build-push-action@v2
with:
push: true
tags: jsreport/website:${{ github.event.release.tag_name }}
- shell: bash
env:
KUBERNETES: ${{ secrets.KUBERNETES }}
TAG: ${{ github.event.release.tag_name }}
run: |
git clone https://github.com/pofider/kubernetes.git
cd kubernetes
git checkout -b website-${TAG}
git config --global user.name "pofider"
git config --global user.email "[email protected]"
sed -i 's/'"jsreport\/website"'\:\(.*\)/'"jsreport\/website"'\:'"${TAG}"'/' ./config/staging/website.yaml
sed -i 's/'"jsreport\/website"'\:\(.*\)/'"jsreport\/website"'\:'"${TAG}"'/' ./config/prod/website.yaml
git add config/staging/website.yaml
git add config/prod/website.yaml
git commit -m "Update the website application"
remote_repo="https://pofider:${KUBERNETES}@github.com/pofider/kubernetes.git"
git push "${remote_repo}" HEAD:website-${TAG}