Skip to content

added grade distribution for Spring 2024 #76

added grade distribution for Spring 2024

added grade distribution for Spring 2024 #76

# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
# More GitHub Actions for Azure: https://github.com/Azure/actions
name: Build and deploy container app to Azure Web App - profstatsutd
on:
push:
branches:
- main
paths:
- '.github/workflows/main_profstatsutd.yml'
- 'api/**'
- 'db_setup/**'
- 'raw_data/**'
workflow_dispatch:
jobs:
build:
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Run create_db.py
run: python db_setup/create_db.py
- name: Run test_db.py
run: python db_setup/test_db.py
continue-on-error: false
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21.x'
- name: Install dependencies
working-directory: api
run: go get .
- name: Test with Go
working-directory: api
run: go test -v ./...
continue-on-error: false
- name: Log in to registry
uses: docker/login-action@v2
with:
registry: https://profstatsutd.azurecr.io/
username: ${{ secrets.AzureAppService_ContainerUsername_2fb3c42f9bb3480fb330b720e0712f47 }}
password: ${{ secrets.AzureAppService_ContainerPassword_19fcb5b141e34c0c8519b1ed64186dc3 }}
- name: Build and push container image to registry
uses: docker/build-push-action@v3
with:
context: api
push: true
tags: profstatsutd.azurecr.io/${{ secrets.AzureAppService_ContainerUsername_2fb3c42f9bb3480fb330b720e0712f47 }}/profstatsutd/profstatsutd:${{ github.sha }}
file: api/Dockerfile
deploy:
runs-on: ubuntu-latest
needs: build
environment:
name: 'production'
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
steps:
- name: Deploy to Azure Web App
id: deploy-to-webapp
uses: azure/webapps-deploy@v2
with:
app-name: 'profstatsutd'
slot-name: 'production'
publish-profile: ${{ secrets.AzureAppService_PublishProfile_f299f533dbac46e79203811d099b1c21 }}
images: 'profstatsutd.azurecr.io/${{ secrets.AzureAppService_ContainerUsername_2fb3c42f9bb3480fb330b720e0712f47 }}/profstatsutd/profstatsutd:${{ github.sha }}'