Skip to content

EREGCSC-2046 -- Add external link icon to citation #896

EREGCSC-2046 -- Add external link icon to citation

EREGCSC-2046 -- Add external link icon to citation #896

name: "Remove Experimental"
on:
workflow_dispatch:
pull_request:
types: [ closed ]
permissions:
id-token: write
contents: read
actions: read
jobs:
remove:
environment:
name: "dev"
runs-on: ubuntu-20.04
steps:
# gettign PR is trivial here because the only tirgger is closing a PR
- name: Echo PR#
env:
PR: ${{ github.event.number }}
run: echo "Your PR is ${PR}"
# Checkout the code
- uses: actions/checkout@v3
with:
submodules: true
# Setup Node
- uses: actions/setup-node@v3
with:
node-version: 18.14
# Setup Python
- uses: actions/setup-python@v4
with:
python-version: '3.9'
# Configure AWS credentials for GitHub Actions
- name: Configure AWS credentials for GitHub Actions
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ secrets.AWS_OIDC_ROLE_TO_ASSUME }}
aws-region: us-east-1
# Remove parsers
- name: remove parsers
env:
PR: ${{ github.event.number }}
run: |
pushd solution/parser
npm install serverless -g
npm install
chmod +x ~/work/cmcs-eregulations/cmcs-eregulations/.github/workflows/delete_cloudformation_stacks.sh
~/work/cmcs-eregulations/cmcs-eregulations/.github/workflows/delete_cloudformation_stacks.sh cmcs-eregs-parser-dev${PR} $PR "./serverless-ecfr.yml"
~/work/cmcs-eregulations/cmcs-eregulations/.github/workflows/delete_cloudformation_stacks.sh cmcs-eregs-fr-parser-dev${PR} $PR "./serverless-fr.yml"
popd
# remove the regulations site
- name: remove experimental regulations site server
# If previous step fails the database will not be removed and you cannot rerun it
# In this instance we want to just remove the database so that we dont have
# to go into the database and do it manually.
# If process is manually stopped it will not run this step.
if: success() || failure()
env:
PR: ${{ github.event.number }}
run: |
pushd solution/backend
npm install serverless -g
npm install
# remove the database if its there.
serverless invoke --config ./serverless-experimental.yml --function drop_database --stage dev${PR}
~/work/cmcs-eregulations/cmcs-eregulations/.github/workflows/delete_cloudformation_stacks.sh cmcs-eregs-site-dev${PR} $PR "./serverless-experimental.yml"
popd
# Remove the static assets
- name: remove static assets
env:
PR: ${{ github.event.number }}
run: |
pushd solution/static-assets
npm install serverless -g
npm install
serverless remove --stage dev${PR}
popd