forked from louislam/uptime-kuma
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ed37cf5
commit 3197d51
Showing
1 changed file
with
27 additions
and
17 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: | ||
|
@@ -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 }} |