some adjustments to deploy-production #45
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: Deploy production from main | |
| on: | |
| push: | |
| branches: [main] | |
| env: | |
| NODE_VERSION: "18.x" | |
| concurrency: production-environment | |
| jobs: | |
| build-and-deploy: | |
| name: Build and deploy | |
| runs-on: ubuntu-latest | |
| environment: production | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v4 | |
| - name: Use Node.js ${{ env.NODE_VERSION }} | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: 'yarn' | |
| - name: Install dependencies | |
| env: | |
| STRAPI_LICENSE: ${{ secrets.STRAPI_LICENSE }} | |
| run: yarn install --silent | |
| - name: Build project | |
| run: yarn build | |
| - name: Zip build folder | |
| run: zip -r release.zip build | |
| - name: Deploy to Azure Web App (run from zip) | |
| uses: azure/webapps-deploy@v3 | |
| with: | |
| app-name: pof-backend-production | |
| publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} | |
| package: release.zip | |
| type: zip | |
| clean: true |