Skip to content

Merge pull request #18 from NewmanJustice/myteam #89

Merge pull request #18 from NewmanJustice/myteam

Merge pull request #18 from NewmanJustice/myteam #89

Workflow file for this run

# 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 - OKR
on:
push:
branches:
- main
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: Log in to registry
uses: docker/login-action@v2
with:
registry: https://index.docker.io/v1/
username: ${{ secrets.AzureAppService_ContainerUsername_9ce183ada55e4fdb9d80cdae25e964a6 }}
password: ${{ secrets.AzureAppService_ContainerPassword_d5a5298b7a0f4865aab8305c98d57098 }}
- name: Create .env file for build
run: |
echo "NEXT_PUBLIC_HCAPTCHA_SITE_KEY=${{ secrets.NEXT_PUBLIC_HCAPTCHA_SITE_KEY }}" >> .env
echo "EMAIL_PROVIDER=govnotify" >> .env
echo "GOV_NOTIFY_API_KEY=${{ secrets.GOV_NOTIFY_API_KEY }}" >> .env
echo "GOV_NOTIFY_RESET_PASSWORD_TEMPLATE_ID=${{ secrets.GOV_NOTIFY_RESET_PASSWORD_TEMPLATE_ID }}" >> .env
echo "GOV_NOTIFY_VERIFY_ACCOUNT_TEMPLATE_ID=${{ secrets.GOV_NOTIFY_VERIFY_ACCOUNT_TEMPLATE_ID }}" >> .env
# Add other frontend env vars as needed
#- name: Run Prisma migrations on production DB
# run: npx prisma migrate deploy
#env:
# DATABASE_URL: ${{ secrets.DATABASE_URL }}
- name: Build and push container image to registry
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: index.docker.io/${{ secrets.AzureAppService_ContainerUsername_9ce183ada55e4fdb9d80cdae25e964a6 }}/okr-manager:${{ github.sha }}
file: ./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: 'OKR'
publish-profile: ${{ secrets.AzureAppService_PublishProfile_e2cf51908226441f96a3a6a3a814d37d }}
images: 'index.docker.io/${{ secrets.AzureAppService_ContainerUsername_9ce183ada55e4fdb9d80cdae25e964a6 }}/okr-manager:${{ github.sha }}'