Skip to content

chore(index): include csp #116

chore(index): include csp

chore(index): include csp #116

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'
- 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 }}