diff --git a/.github/workflows/new-file-upload-system_forestgeo-livesite.yml b/.github/workflows/new-file-upload-system_forestgeo-livesite.yml index 0394b815..09d4bccc 100644 --- a/.github/workflows/new-file-upload-system_forestgeo-livesite.yml +++ b/.github/workflows/new-file-upload-system_forestgeo-livesite.yml @@ -12,7 +12,18 @@ on: jobs: build: runs-on: ubuntu-latest - environment: development + environment: + name: 'development' + env: + AZURE_AD_CLIENT_SECRET: ${{ secrets.AZURE_AD_CLIENT_SECRET }} + AZURE_AD_CLIENT_ID: ${{ secrets.AZURE_AD_CLIENT_ID }} + AZURE_AD_TENANT_ID: ${{ secrets.AZURE_AD_TENANT_ID }} + NEXTAUTH_SECRET: ${{ secrets.NEXTAUTH_SECRET }} + AZURE_SQL_USER: ${{ secrets.AZURE_SQL_USER }} + AZURE_SQL_PASSWORD: ${{ secrets.AZURE_SQL_PASSWORD }} + AZURE_SQL_SERVER: ${{ secrets.AZURE_SQL_SERVER }} + AZURE_SQL_DATABASE: ${{ secrets.AZURE_SQL_DATABASE }} + steps: - uses: actions/checkout@v4 @@ -21,22 +32,6 @@ jobs: with: node-version: '18.x' - - name: create frontend env file - run: | - touch frontend/.env - echo AZURE_AD_CLIENT_SECRET=${{ secrets.AZURE_AD_CLIENT_SECRET }} >> frontend/.env - echo AZURE_AD_CLIENT_ID=${{ secrets.AZURE_AD_CLIENT_ID }} >> frontend/.env - echo AZURE_AD_TENANT_ID=${{ secrets.AZURE_AD_TENANT_ID }} >> frontend/.env - echo NEXTAUTH_SECRET=${{ secrets.NEXTAUTH_SECRET }} >> frontend/.env - echo AZURE_SQL_USER=${{ secrets.AZURE_SQL_USER }} >> frontend/.env - echo AZURE_SQL_PASSWORD=${{ secrets.AZURE_SQL_PASSWORD }} >> frontend/.env - echo AZURE_SQL_SERVER=${{ secrets.AZURE_SQL_SERVER }} >> frontend/.env - echo AZURE_SQL_DATABASE=${{ secrets.AZURE_SQL_DATABASE }} >> frontend/.env - echo AZURE_SQL_PORT=${{ secrets.AZURE_SQL_PORT }} >> frontend/.env - echo AZURE_STORAGE_SAS_CONNECTION_STRING=${{ secrets.AZURE_STORAGE_SAS_CONNECTION_STRING }} >> frontend/.env - echo AZURE_SQL_SCHEMA=${{ secrets.AZURE_SQL_SCHEMA }} >> frontend/.env - echo AZURE_STORAGE_CONNECTION_STRING=${{ secrets.AZURE_STORAGE_CONNECTION_STRING }} >> frontend/.env - # - name: Cache node modules # uses: actions/cache@v2 # with: @@ -67,6 +62,15 @@ jobs: environment: name: 'development' url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} + env: + AZURE_AD_CLIENT_SECRET: ${{ secrets.AZURE_AD_CLIENT_SECRET }} + AZURE_AD_CLIENT_ID: ${{ secrets.AZURE_AD_CLIENT_ID }} + AZURE_AD_TENANT_ID: ${{ secrets.AZURE_AD_TENANT_ID }} + NEXTAUTH_SECRET: ${{ secrets.NEXTAUTH_SECRET }} + AZURE_SQL_USER: ${{ secrets.AZURE_SQL_USER }} + AZURE_SQL_PASSWORD: ${{ secrets.AZURE_SQL_PASSWORD }} + AZURE_SQL_SERVER: ${{ secrets.AZURE_SQL_SERVER }} + AZURE_SQL_DATABASE: ${{ secrets.AZURE_SQL_DATABASE }} steps: - name: Download artifact from build job @@ -74,6 +78,9 @@ jobs: with: name: node-app + - name: Unzip artifact for deployment + run: unzip release.zip + - name: 'Deploy to Azure Web App' id: deploy-to-webapp uses: azure/webapps-deploy@v2 @@ -81,4 +88,4 @@ jobs: app-name: 'forestgeo-livesite' slot-name: 'development' publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} - package: ./release.zip + package: . diff --git a/frontend/.gitignore b/frontend/.gitignore index 9568cc97..a04dd9cf 100644 --- a/frontend/.gitignore +++ b/frontend/.gitignore @@ -11,6 +11,7 @@ /coverage # next.js +/.next/ /out/ # production