Merge pull request #1012 from aziontech/revert-1011-dev #35
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy Console Kit (PRODUCTION) | |
on: | |
push: | |
branches: | |
- main | |
env: | |
HUSKY: 0 | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
container: | |
image: node:18-alpine3.18 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Install SO deps | |
run: apk add curl git bash jq | |
- name: Install dependencies | |
run: yarn install | |
- name: Build | |
run: yarn build --mode production | |
env: | |
VITE_RECAPTCHA_SITE_KEY: ${{ secrets.PROD_RECAPTCHA_SITE_KEY }} | |
- name: Download Azion CLI | |
run: curl https://downloads.azion.com/linux/x86_64/azioncli -o azioncli && chmod +x azioncli | |
- name: Create YML file to Azion CLI | |
run: mkdir ~/.config/ && touch ~/.config/azioncli.yaml | |
- name: Configure Azion CLI | |
run: ./azioncli configure -t ${{ secrets.PLATFORM_KIT_TOKEN }} | |
- name: Define application settings | |
run: > | |
echo $(jq | |
--arg funcid ${{secrets.PROD_EDGE_FUNCTION_ID}} | |
--arg appid ${{secrets.PROD_EDGE_APPLICATION_ID}} | |
--arg domainid ${{secrets.PROD_DOMAIN_ID}} | |
'.name = "Console PK - Production" | |
| .function.id = ($funcid|tonumber) | |
| .application.id = ($appid|tonumber) | |
| .domain.id = ($domainid|tonumber)' | |
azion/azion.json) > azion/azion.json | |
- name: Configure Repository | |
run: mkdir -p .edge/statics && cp -r ./dist/* .edge/statics | |
- name: Deploy Edge Application | |
run: ./azioncli edge_applications publish |