Skip to content

Make "Koop abonnement" button URL dependent on municipality #35

Make "Koop abonnement" button URL dependent on municipality

Make "Koop abonnement" button URL dependent on municipality #35

name: Build and deploy Veiligstallen app to Azure Web App (Production Environment)
on:
push:
branches:
- main
paths-ignore:
- "README.md"
- ".husky"
- ".github/**"
- "**/*.csv"
- .env*
- azure/*
- github/*
- scripts/*
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
environment: production
steps:
- uses: actions/checkout@v2
- name: Set up Node.js version
uses: actions/setup-node@v1
with:
node-version: "18.x"
- name: create env file
env:
NEXT_PUBLIC_API_BASE_URL: ${{ vars.PROD_NEXT_PUBLIC_API_BASE_URL }}
NEXT_PUBLIC_WEB_BASE_URL: ${{ vars.PROD_NEXT_PUBLIC_WEB_BASE_URL }}
DATABASE_URL: ${{vars.PROD_DATABASE_URL}}
NEXTAUTH_SECRET: ${{vars.PROD_NEXTAUTH_SECRET}}
NEXTAUTH_URL: ${{vars.PROD_NEXTAUTH_URL}}
NEXT_PUBLIC_MAPBOX_TOKEN: ${{vars.PROD_NEXT_PUBLIC_MAPBOX_TOKEN}}
run: |
touch .env
echo "NEXT_PUBLIC_API_BASE_URL=$NEXT_PUBLIC_API_BASE_URL" >> .env
echo "NEXT_PUBLIC_WEB_BASE_URL=$NEXT_PUBLIC_WEB_BASE_URL" >> .env
echo "NODE_ENV=production >>" .env
echo "DATABASE_URL=$DATABASE_URL" >> .env
echo "NEXTAUTH_SECRET=$NEXTAUTH_SECRET" >> .env
echo "NEXTAUTH_URL=$NEXTAUTH_URL" >> .env
echo "NEXT_PUBLIC_MAPBOX_TOKEN=$NEXT_PUBLIC_MAPBOX_TOKEN" >> .env
- name: print env file
run: cat .env
- name: npm install, build, and test
env:
NEXT_PUBLIC_API_BASE_URL: ${{ vars.PROD_NEXT_PUBLIC_API_BASE_URL }}
NEXT_PUBLIC_WEB_BASE_URL: ${{ vars.PROD_NEXT_PUBLIC_WEB_BASE_URL }}
DATABASE_URL: ${{vars.PROD_DATABASE_URL}}
NEXTAUTH_SECRET: ${{vars.PROD_NEXTAUTH_SECRET}}
NEXTAUTH_URL: ${{vars.PROD_NEXTAUTH_URL}}
NEXT_PUBLIC_MAPBOX_TOKEN: ${{vars.PROD_NEXT_PUBLIC_MAPBOX_TOKEN}}
run: |
npm install
npm run build
mv ./build/static ./build/standalone/build
mv ./public ./build/standalone
- name: "Deploy to Azure Web App"
id: deploy-to-webapp
uses: azure/webapps-deploy@v2
with:
app-name: ${{ vars.PROD_AZURE_APP_NAME}}
publish-profile: ${{ vars.PROD_AZUREAPPSERVICE_PUBLISHPROFILE_VEILIGSTALLEN }}
package: ./build/standalone