2022-06-08 21:32:20 +02:00
|
|
|
---
|
|
|
|
name: QA - Web Release
|
|
|
|
|
|
|
|
on:
|
2022-09-22 17:46:17 +02:00
|
|
|
workflow_dispatch: {}
|
2022-06-08 21:32:20 +02:00
|
|
|
|
|
|
|
jobs:
|
2022-07-13 15:45:52 +02:00
|
|
|
cfpages-deploy:
|
|
|
|
name: Deploy Web Vault to QA CloudFlare Pages branch
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
2022-07-25 23:20:17 +02:00
|
|
|
- name: Create GitHub deployment
|
2023-05-05 22:17:19 +02:00
|
|
|
uses: chrnorm/deployment-action@d42cde7132fcec920de534fffc3be83794335c00 # v2.0.5
|
2022-07-25 23:20:17 +02:00
|
|
|
id: deployment
|
|
|
|
with:
|
|
|
|
token: '${{ secrets.GITHUB_TOKEN }}'
|
2022-08-08 19:21:49 +02:00
|
|
|
initial-status: 'in_progress'
|
2022-07-25 23:20:17 +02:00
|
|
|
environment-url: http://vault.qa.bitwarden.pw
|
|
|
|
environment: 'Web Vault - QA'
|
|
|
|
description: 'Deployment from branch ${{ github.ref_name }}'
|
2022-08-25 10:02:13 +02:00
|
|
|
|
2022-07-13 15:45:52 +02:00
|
|
|
- name: Checkout Repo
|
2023-05-09 18:38:11 +02:00
|
|
|
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
|
2022-07-13 15:45:52 +02:00
|
|
|
|
|
|
|
- name: Download latest cloud asset
|
2023-05-24 15:33:02 +02:00
|
|
|
uses: bitwarden/gh-actions/download-artifacts@c86ced0dc8c9daeecf057a6333e6f318db9c5a2b
|
2022-07-13 15:45:52 +02:00
|
|
|
with:
|
|
|
|
workflow: build-web.yml
|
2022-10-13 19:54:26 +02:00
|
|
|
path: apps/web
|
2022-07-13 15:45:52 +02:00
|
|
|
workflow_conclusion: success
|
|
|
|
branch: ${{ github.ref_name }}
|
2022-09-19 22:38:19 +02:00
|
|
|
artifacts: web-*-cloud-QA.zip
|
2023-01-27 22:40:50 +01:00
|
|
|
|
2022-10-13 19:54:26 +02:00
|
|
|
- name: Unzip cloud asset
|
|
|
|
working-directory: apps/web
|
|
|
|
run: unzip web-*-cloud-QA.zip
|
2022-07-13 15:45:52 +02:00
|
|
|
|
|
|
|
- name: Checkout Repo
|
2023-05-09 18:38:11 +02:00
|
|
|
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
|
2022-07-13 15:45:52 +02:00
|
|
|
with:
|
|
|
|
ref: cf-pages-qa
|
|
|
|
path: deployment
|
|
|
|
|
|
|
|
- name: Setup git config
|
|
|
|
run: |
|
|
|
|
git config --global user.name "GitHub Action Bot"
|
|
|
|
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
|
|
git config --global url."https://github.com/".insteadOf ssh://git@github.com/
|
|
|
|
git config --global url."https://".insteadOf ssh://
|
|
|
|
|
|
|
|
- name: Deploy CloudFlare Pages
|
|
|
|
run: |
|
|
|
|
rm -rf ./*
|
|
|
|
cp -R ../apps/web/build/* .
|
|
|
|
working-directory: deployment
|
|
|
|
|
|
|
|
- name: Push new ver to cf-pages-qa
|
|
|
|
run: |
|
|
|
|
if [ -n "$(git status --porcelain)" ]; then
|
|
|
|
git add .
|
|
|
|
git commit -m "Deploy ${{ github.ref_name }} to QA Cloudflare pages"
|
|
|
|
git push -u origin cf-pages-qa
|
|
|
|
else
|
|
|
|
echo "No changes to commit!";
|
|
|
|
fi
|
|
|
|
working-directory: deployment
|
2022-07-25 23:20:17 +02:00
|
|
|
|
|
|
|
- name: Update deployment status to Success
|
2022-08-08 19:21:49 +02:00
|
|
|
if: ${{ success() }}
|
2023-05-05 22:17:19 +02:00
|
|
|
uses: chrnorm/deployment-status@2afb7d27101260f4a764219439564d954d10b5b0 # v2.0.1
|
2022-07-25 23:20:17 +02:00
|
|
|
with:
|
|
|
|
token: '${{ secrets.GITHUB_TOKEN }}'
|
|
|
|
environment-url: http://vault.qa.bitwarden.pw
|
|
|
|
state: 'success'
|
|
|
|
deployment-id: ${{ steps.deployment.outputs.deployment_id }}
|
|
|
|
|
|
|
|
- name: Update deployment status to Failure
|
2022-08-08 19:21:49 +02:00
|
|
|
if: ${{ failure() }}
|
2023-05-05 22:17:19 +02:00
|
|
|
uses: chrnorm/deployment-status@2afb7d27101260f4a764219439564d954d10b5b0 # v2.0.1
|
2022-07-25 23:20:17 +02:00
|
|
|
with:
|
|
|
|
token: '${{ secrets.GITHUB_TOKEN }}'
|
|
|
|
environment-url: http://vault.qa.bitwarden.pw
|
|
|
|
state: 'failure'
|
|
|
|
deployment-id: ${{ steps.deployment.outputs.deployment_id }}
|