Skip to content

Commit

Permalink
Create a GitHub action to deploy the ingest inspector (#1130)
Browse files Browse the repository at this point in the history
  • Loading branch information
StepanBrychta committed Jul 3, 2024
1 parent cb733c8 commit 267d561
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/deploy-ingest-inspector.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Deploy Ingest Inspector
on:
push
# push:
# branches:
# - main

permissions:
id-token: write

jobs:
deploy_ingest_inspector:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: eu-west-1
role-to-assume: ${{ secrets.DEPLOY_INGEST_INSPECTOR_GHA_ROLE_ARN }}
- name: Deploy Ingest Inspector backend
run: |
python3 ./builds/publish_lambda_zip.py monitoring/ingest_inspector/backend_lambda --bucket=wellcomecollection-storage-infra --key=lambdas/monitoring/ingest_inspector_backend.zip
- name: Deploy Ingest Inspector frontend
run: |
cd monitoring/ingest_inspector/frontend
sh deploy.sh
2 changes: 1 addition & 1 deletion monitoring/ingest_inspector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,6 @@ The frontend is hosted as a static website on S3 and served via CloudFront. To b
the `ingest_inspector/frontend` directory and run:

```shell
sh deploy.sh
AWS_PROFILE=storage-developer sh deploy.sh
```

5 changes: 4 additions & 1 deletion monitoring/ingest_inspector/frontend/deploy.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/sh

echo "Installing packages..."
npm install

echo "Building app..."
npm run build

Expand All @@ -9,7 +12,7 @@ if [ $? -ne 0 ]; then
fi

echo "Uploading to S3..."
AWS_PROFILE=storage-developer aws s3 cp out s3://wellcomecollection-ingest-inspector-frontend --recursive --only-show-errors
aws s3 cp out s3://wellcomecollection-ingest-inspector-frontend --recursive --only-show-errors

if [ $? -eq 0 ]; then
echo "Success!"
Expand Down

0 comments on commit 267d561

Please sign in to comment.