Merge pull request #9 from Paul-Borisov/beta-1.2 #10
This file contains hidden or 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
| name: This is a Github CI workflow to build and deploy a standalone Next.js app to Azure App Service | |
| on: | |
| push: | |
| branches: | |
| - main | |
| env: | |
| SERVICE_NAME: ${{ secrets.AZURE_APP_SERVICE_NAME }} | |
| PUBLISH_PROFILE: ${{ secrets.AZURE_APP_SERVICE_PUBLISH_PROFILE }} | |
| WORKING_DIRECTORY: src | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20.x" | |
| - name: npm install and build | |
| working-directory: ${{env.WORKING_DIRECTORY}} | |
| run: | | |
| echo '${{secrets.ENV_FILE_CONTENT}}' > ${{github.workspace}}/${{env.WORKING_DIRECTORY}}/.env | |
| npm install | |
| npm run plain | |
| cp -r -f .next/static .next/standalone/.next/static | |
| cp -r -f public .next/standalone/public | |
| - name: "Deploy to Azure App Service" | |
| id: deploy-to-app-service | |
| uses: azure/webapps-deploy@v3 | |
| with: | |
| app-name: ${{env.SERVICE_NAME}} | |
| slot-name: "Production" | |
| publish-profile: ${{env.PUBLISH_PROFILE}} | |
| package: ${{env.WORKING_DIRECTORY}}/.next |