Skip to content

Commit 3aa3b2a

Browse files
Introduce more workflow updates (#306)
1 parent 019280b commit 3aa3b2a

File tree

5 files changed

+44
-5
lines changed

5 files changed

+44
-5
lines changed

.github/workflows/deploy.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,23 @@ on:
1010
- 'docker*'
1111
- 'Docker*'
1212

13+
concurrency:
14+
group: deploy-production
15+
cancel-in-progress: false
16+
1317
jobs:
1418
deploy:
1519
runs-on: ubuntu-latest
20+
timeout-minutes: 15
1621
steps:
17-
- uses: actions/checkout@v2
18-
- uses: actions/setup-node@v2
22+
- uses: actions/checkout@v4
23+
- uses: actions/setup-node@v4
1924
with:
2025
node-version: '20.x'
26+
cache: 'npm'
2127
- name: 🔧 Create build
2228
run: |
23-
npm install
29+
npm ci
2430
npm run build
2531
- name: 🚀 Deploy
2632
run: |

.github/workflows/playwright.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ jobs:
3131
with:
3232
name: playwright-report
3333
path: playwright-report/
34-
retention-days: 30
34+
retention-days: 1

.github/workflows/preview-build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
- uses: actions/setup-node@v4
2626
with:
2727
node-version: '20.x'
28+
cache: 'npm'
2829

2930
- name: 🔧 Install and build
3031
run: |

.github/workflows/preview-deploy.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,32 @@ jobs:
6464
context: 'PR Preview Deploy'
6565
});
6666
67+
- name: ❌ Update PR status on failure
68+
if: failure()
69+
uses: actions/github-script@v7
70+
with:
71+
github-token: ${{ secrets.GITHUB_TOKEN }}
72+
script: |
73+
const prNumber = parseInt('${{ steps.pr.outputs.number }}');
74+
if (!prNumber) {
75+
console.log('PR number not available, skipping status update');
76+
return;
77+
}
78+
const { data: pr } = await github.rest.pulls.get({
79+
owner: context.repo.owner,
80+
repo: context.repo.repo,
81+
pull_number: prNumber
82+
});
83+
await github.rest.repos.createCommitStatus({
84+
owner: context.repo.owner,
85+
repo: context.repo.repo,
86+
sha: pr.head.sha,
87+
state: 'failure',
88+
target_url: `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`,
89+
description: 'Preview deployment failed',
90+
context: 'PR Preview Deploy'
91+
});
92+
6793
- name: 🌐 Comment preview URL
6894
uses: actions/github-script@v7
6995
with:

package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
{
22
"name": "valhalla-web",
33
"version": "1.0.0",
4+
"description": "Web interface for Valhalla routing engine",
45
"private": false,
6+
"license": "MIT",
57
"homepage": "https://valhalla.openstreetmap.de",
8+
"repository": {
9+
"type": "git",
10+
"url": "https://github.com/valhalla/web-app"
11+
},
612
"type": "module",
713
"scripts": {
814
"dev": "vite",
@@ -17,7 +23,7 @@
1723
"lint": "eslint .",
1824
"prettier": "prettier --write \"**/*.{json,md,scss,yaml,yml,js,jsx,ts,tsx}\"",
1925
"prettier:check": "prettier --check \"**/*.{json,md,scss,yaml,yml,js,jsx,ts,tsx}\"",
20-
"check": "yarn prettier:check && yarn lint",
26+
"check": "npm run prettier:check && npm run lint",
2127
"typecheck": "tsc --noEmit",
2228
"deploy": "gh-pages -d build",
2329
"prepare": "husky",

0 commit comments

Comments
 (0)