feat: OAuth api permissions and user creation #254
Workflow file for this run
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
# The name of the deployment | |
name: Deploy preview environments on PR | |
# When this action will be executed | |
on: | |
pull_request: | |
types: [opened, synchronize] | |
branches: | |
- main | |
paths: | |
- 'web/dashboard/**' | |
- '.github/workflows/dashboard-preview.yml' | |
workflow_dispatch: | |
env: | |
PR_NUMBER: ${{ github.event.number }} | |
jobs: | |
deploy_preview: | |
environment: playground | |
name: Deploy preview environment to Container App | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v3 | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Log in to Azure | |
uses: azure/login@v1 | |
with: | |
creds: ${{ secrets.AZURE_CREDENTIALS }} | |
- name: Create Neon Branch | |
id: create-branch | |
uses: neondatabase/create-branch-action@v4 | |
with: | |
project_id: ${{ env.NEON_PROJECT_ID }} | |
branch_name: preview/pr-${{ github.event.number }} | |
username: ${{ env.NEON_DATABASE_USERNAME }} | |
api_key: ${{ secrets.NEON_API_KEY }} | |
- name: Setup environment | |
run: | | |
echo "${{ secrets.AZURE_BLOB_STORAGE_ACCOUNT }}" >> ./web/dashboard/.env | |
echo "${{ secrets.AZURE_BLOB_STORAGE_SECRET }}" >> ./web/dashboard/.env | |
echo "${{ secrets.NEXT_AUTH_SECRET }}" >> ./web/dashboard/.env | |
echo "${{ secrets.COMMUNICATION_SERVICES_CONNECTION_STRING }}" >> ./web/dashboard/.env | |
echo "${{ secrets.AUTH_MICROSOFT_ENTRA }}" >> ./web/dashboard/.env | |
echo "AZURE_CONTAINER_NAME=remote-components-aem-demo" >> ./web/dashboard/.env | |
echo "EMAIL_FROM=DoNotReply@c7a8ef4a-56f7-41de-b9ab-6754e39702ca.azurecomm.net" >> ./web/dashboard/.env | |
echo "DRIZZLE_DATABASE_TYPE=neon" >> ./web/dashboard/.env | |
echo "DRIZZLE_DATABASE_URL=${{ steps.create-branch.outputs.db_url }}?sslmode=require" >> ./web/dashboard/.env | |
cd ./web/dashboard | |
corepack enable && corepack prepare [email protected] --activate | |
pnpm i --frozen-lockfile | |
pnpm --filter "@ethereal-nexus/dashboard" run db:push --force | |
- name: Deploy Container App | |
uses: azure/container-apps-deploy-action@v1 | |
with: | |
containerAppName: ethereal-nexus-app-${{ github.event.number }} | |
appSourcePath: ${{ github.workspace }} | |
dockerfilePath: web/dashboard/Dockerfile | |
acrName: etherealnexus | |
acrUsername: ${{ secrets.REGISTRY_USERNAME }} | |
acrPassword: ${{ secrets.REGISTRY_PASSWORD }} | |
resourceGroup: RG-Ethereal-Nexus | |
location: westeurope | |
targetPort: 3000 | |
- name: Update Environment Variables | |
run: | | |
fqdn=$(az containerapp ingress show -g RG-Ethereal-Nexus -n ethereal-nexus-app-$PR_NUMBER | jq -r '.fqdn') | |
az containerapp update -g RG-Ethereal-Nexus -n ethereal-nexus-app-$PR_NUMBER --set-env-vars NEXTAUTH_URL=https://${fqdn} |