VIDCS-3303: Improve .env config documentation and example #35
Workflow file for this run
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 to VCR | |
on: | |
pull_request: | |
branches: | |
- develop | |
types: [closed] | |
permissions: | |
contents: read | |
env: | |
VITE_ENABLE_REPORT_ISSUE: ${{secrets.VITE_ENABLE_REPORT_ISSUE}} | |
jobs: | |
build-and-test: | |
if: github.event.pull_request.merged == true | |
runs-on: [vcp-runner] | |
steps: | |
- name: Checkout code | |
uses: actions/[email protected] | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 22.4 | |
cache: npm | |
- name: Install Dependencies | |
run: | | |
node -v | |
npm -v | |
npm install --global yarn | |
yarn | |
- name: Install VCR CLI | |
run: | | |
sudo curl -L https://raw.githubusercontent.com/Vonage/cloud-runtime-cli/main/script/install.sh | sudo sh | |
vcr -v | |
- name: Deploy vcr | |
run: | | |
yarn build | |
vcr deploy --filename vcr.yml --app-id ${{secrets.APP_ID}} --api-key ${{ secrets.VCR_API_KEY }} --api-secret ${{ secrets.VCR_API_SECRET }} --region aws.euw1 --graphql-endpoint https://graphql.euw1.runtime.vonage.cloud/v1/graphql --timeout=15m 2>&1 | tee deploy-vcr-logs.log | |
echo "Checking if the deploy job is successful" | |
if grep -Fxq '| Instance has been deployed!' ./deploy-vcr-logs.log ; then | |
echo "success in deployment" | |
exit 0 | |
else | |
echo "failure in deployment" | |
exit 1 | |
fi | |
- name: Slack notification on success | |
uses: slackapi/[email protected] | |
with: | |
channel-id: '#tb-web-ci' | |
payload: | | |
{ | |
"text": "Vera Deployment GHA Job", | |
"attachments": [ | |
{ | |
"color": "28a745", | |
"text": "Vera pull request *<https://github.com/Vonage/vonage-video-react-app/pull/${{ github.event.number }}|${{ github.event.pull_request.title }}>* \n with commit hash: ${{ github.sha }} \n is merged and deployed to VCR \n*<https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|Click here to go to build logs>* \n :large_green_circle: :large_green_circle: :large_green_circle: :large_green_circle:" | |
} | |
] | |
} | |
env: | |
SLACK_BOT_TOKEN: ${{ secrets.SLACK_NOTIFICATION }} | |
if: success() | |
continue-on-error: true | |
- name: Slack notification on failure | |
uses: slackapi/[email protected] | |
with: | |
channel-id: '#tb-web-ci' | |
payload: | | |
{ | |
"text": "Vera Deployment GHA Job", | |
"attachments": [ | |
{ | |
"color": "FF0000", | |
"text": "Vera pull request *<https://github.com/Vonage/vonage-video-react-app/pull/${{ github.event.number }}|${{ github.event.pull_request.title }}>* \n with commit hash: ${{ github.sha }} \n is merged but FAILED to deploy to VCR \n *<https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|Click here to go to build logs>* \n :red_circle: :red_circle: :red_circle: :red_circle:" | |
} | |
] | |
} | |
env: | |
SLACK_BOT_TOKEN: ${{ secrets.SLACK_NOTIFICATION }} | |
if: failure() | |
continue-on-error: true |