Skip to content

Merge pull request #3 from SonOfLope/weather-app #1

Merge pull request #3 from SonOfLope/weather-app

Merge pull request #3 from SonOfLope/weather-app #1

Workflow file for this run

name: Build and deploy to production
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Set up Node.js version
uses: actions/setup-node@v3
with:
node-version: '18.x'
- name: Install dependencies and build
working-directory: ./weather-app
run: |
npm install
npm run build
- name: Zip artifact for deployment
working-directory: ./weather-app
run: zip -r ../release.zip ./*
- name: Upload artifact for deployment job
uses: actions/upload-artifact@v4
with:
name: node-app
path: release.zip
deploy-staging:
runs-on: ubuntu-latest
needs: build
environment:
name: 'Production'
url: ${{ steps.deploy-to-webapp-prod.outputs.webapp-url }}
permissions:
id-token: write
contents: read
steps:
- name: Download artifact from build job
uses: actions/download-artifact@v4
with:
name: node-app
- name: Unzip artifact for deployment
run: unzip release.zip
- name: Login to Azure
uses: azure/login@v2
with:
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_6825A8BBB6054717A51D3387CB0BDAA2 }}
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_F0A2C46FD2B74B6EBF701F4F68664556 }}
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_6A39DE00D4CD4142A2B79B40F2FB0C5A }}
- name: 'Deploy to Azure Web App Staging'
id: deploy-to-webapp-prod
uses: azure/webapps-deploy@v3
with:
app-name: 'az204svelte'
slot-name: 'az204svelte'
package: '.'