Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
la-neumann committed Jan 29, 2025
1 parent ed37cf5 commit 3197d51
Showing 1 changed file with 27 additions and 17 deletions.
44 changes: 27 additions & 17 deletions .github/workflows/azure-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,60 +8,70 @@ on:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true # Cancel any running deployments
cancel-in-progress: true

jobs:
build-and-deploy:
runs-on: ubuntu-latest
timeout-minutes: 10
timeout-minutes: 20 # Increased timeout for stability

strategy:
matrix:
node-version: [20]
fail-fast: false

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Cache Node.js modules
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'

- name: Clean install dependencies
- name: Install dependencies
run: |
rm -rf node_modules
rm -f package-lock.json
npm install --no-audit --no-optional
npm ci
npm install [email protected] [email protected] [email protected]
- name: Build
env:
NODE_ENV: production
SKIP_LINT: true # Skip linting during build
SKIP_LINT: true
run: |
npm run build
- name: Prepare deployment package
run: |
# Create deployment config
echo "[config]
SCM_DO_BUILD_DURING_DEPLOYMENT=false" > .deployment
# Create a clean deployment package
mkdir deploy
cp -r dist server node_modules package.json .deployment deploy/
cp -r dist server node_modules package.json deploy/
cd deploy
zip -r ../package.zip .
- name: Deploy to Azure App Service
id: deploy
uses: azure/webapps-deploy@v3
uses: azure/webapps-deploy@v4
with:
app-name: uptime-kuma-version-three
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
package: package.zip
clean: true # Enable clean deployment
clean: true # Forces a clean deployment

- name: Restart App Service (Fix Stuck State)
run: |
az webapp restart --name uptime-kuma-version-three --resource-group TestRG
# Set app settings after deployment
- name: Update App Settings
uses: azure/CLI@v1
with:
Expand All @@ -70,4 +80,4 @@ jobs:
env:
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}

0 comments on commit 3197d51

Please sign in to comment.