update app arl #50
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-back | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- server/src/** | |
- server/deploy.sh | |
- server/test-prod.sh | |
- server/Dockerfile | |
- server/requirements.txt | |
jobs: | |
deployment: | |
environment: lifeline-server | |
runs-on: ubuntu-latest | |
steps: | |
- name: git-clone | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: dependencies | |
uses: docker/setup-buildx-action@v2 | |
- name: deploy | |
run: | | |
export AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }} | |
export AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
export AWS_DEFAULT_REGION='us-west-2' | |
sudo apt-get -y update | |
sudo apt-get -y install awscli | |
cd server | |
./deploy.sh | |
# Run this job 5 minutes after the previous job | |
test-deployment: | |
needs: deployment | |
runs-on: ubuntu-latest | |
steps: | |
- name: git-clone | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: dependencies | |
run: | | |
sudo apt-get -y update | |
sudo apt-get -y install curl jq git-lfs | |
git lfs install | |
git lfs pull --include="server/test-data/CPSC331/CPSC331.pdf" | |
- name: test | |
# Give the lambda function time to deploy | |
run: | | |
sleep 120 | |
cd server | |
./test-prod.sh |