diff --git a/.github/workflows/deploy-ingest-inspector.yml b/.github/workflows/deploy-ingest-inspector.yml new file mode 100644 index 000000000..e76db29d4 --- /dev/null +++ b/.github/workflows/deploy-ingest-inspector.yml @@ -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 diff --git a/monitoring/ingest_inspector/README.md b/monitoring/ingest_inspector/README.md index b8b17613a..32a18f431 100644 --- a/monitoring/ingest_inspector/README.md +++ b/monitoring/ingest_inspector/README.md @@ -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 ``` diff --git a/monitoring/ingest_inspector/frontend/deploy.sh b/monitoring/ingest_inspector/frontend/deploy.sh index 0b52e6aef..349f46e9c 100644 --- a/monitoring/ingest_inspector/frontend/deploy.sh +++ b/monitoring/ingest_inspector/frontend/deploy.sh @@ -1,5 +1,8 @@ #!/bin/sh +echo "Installing packages..." +npm install + echo "Building app..." npm run build @@ -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!"