-
Notifications
You must be signed in to change notification settings - Fork 5
69 lines (69 loc) · 2.18 KB
/
deploy-kleobis.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
61
62
63
64
65
66
67
68
69
name: deploy-kleobis
on:
push:
branches:
- 'prod-kleobis'
jobs:
deploy-kleobis:
runs-on: ubuntu-latest
steps:
- run: mkdir src
name: prepare env
- uses: actions/checkout@v2
name: checkout src
with:
fetch-depth: 100
path: 'src'
- uses: actions/setup-node@v4
with:
node-version: "14.18.3"
- name: prepare dist tar
shell: bash
run: |
cd src &&
npm install &&
npm run build.kleobis &&
cd dist/web-frontend-angular/cs/ &&
cp -r ../cgi-bin cgi-bin &&
tar -cvf ../../dist.tar *
- name: create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: temp-${{ github.sha }}
release_name: temp-${{ github.sha }}
body: "Automatic temporary release from the CI/CD"
draft: false
prerelease: true
- name: upload tar to the release
id: upload_tar
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: src/dist/dist.tar
asset_name: build.tar
asset_content_type: application/x-tar
- name: notify backend server
shell: bash
run: |
echo "Asset URL: ${{ steps.upload_tar.outputs.browser_download_url }}"
status="$(curl -X POST -u '${{ secrets.KLEOBIS_DEPLOY_USER }}:${{ secrets.KLEOBIS_DEPLOY_PASSWORD }}' -d '${{ steps.upload_tar.outputs.browser_download_url }}' '${{ secrets.KLEOBIS_DEPLOY_URL }}')"
if [ "$status" = "OK" ]; then
echo "Notified OK!"
else
echo "Notification error"
echo "$status"
false
fi
- name: delete temporary release
if: always()
uses: esoadamo/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-name: temp-${{ github.sha }}