Skip to content

Add email notification for bug reports #5

Add email notification for bug reports

Add email notification for bug reports #5

name: Digital Ocean deployment
on:
push:
paths:
- "backend/**"
branches:
- "main"
jobs:
setup-build-publish-deploy:
name: Setup, Build, Publish, and Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Auth Docker
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Get SHA
id: vars
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
# Build the Docker image
- name: Build
run: |-
docker build --tag "cornellappdev/status-platform:${{ steps.vars.outputs.sha_short }}" ./backend/
# Push the Docker image to Google Container Registry
- name: Publish
run: |-
docker push "cornellappdev/status-platform:${{ steps.vars.outputs.sha_short }}"
- name: SSH & Deploy
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USER }}
key: ${{ secrets.PRIVATE_KEY }}
script: |
export INTEGRATION_IMG_TAG=$(docker images cornellappdev/integration | awk '{print $2}' | awk 'NR==2')
export STATUS_IMG_TAG="${{ steps.vars.outputs.sha_short }}"
echo $INTEGRATION_IMG_TAG > tags.txt
echo $STATUS_IMG_TAG >> tags.txt
docker compose -p status-platform down
yes | sudo docker container prune
yes | sudo docker system prune
docker compose -p status-platform up -d