Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,23 @@ on:
- 'docker*'
- 'Docker*'

concurrency:
group: deploy-production
cancel-in-progress: false
Comment on lines +13 to +15
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah that's a good point!


jobs:
deploy:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'npm'
- name: 🔧 Create build
run: |
npm install
npm ci
npm run build
- name: 🚀 Deploy
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ jobs:
with:
name: playwright-report
path: playwright-report/
retention-days: 30
retention-days: 1
1 change: 1 addition & 0 deletions .github/workflows/preview-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'npm'

- name: 🔧 Install and build
run: |
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/preview-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,32 @@ jobs:
context: 'PR Preview Deploy'
});

- name: ❌ Update PR status on failure
if: failure()
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const prNumber = parseInt('${{ steps.pr.outputs.number }}');
if (!prNumber) {
console.log('PR number not available, skipping status update');
return;
}
const { data: pr } = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: prNumber
});
await github.rest.repos.createCommitStatus({
owner: context.repo.owner,
repo: context.repo.repo,
sha: pr.head.sha,
state: 'failure',
target_url: `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`,
description: 'Preview deployment failed',
context: 'PR Preview Deploy'
});

- name: 🌐 Comment preview URL
uses: actions/github-script@v7
with:
Expand Down
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
{
"name": "valhalla-web",
"version": "1.0.0",
"description": "Web interface for Valhalla routing engine",
"private": false,
"license": "MIT",
"homepage": "https://valhalla.openstreetmap.de",
"repository": {
"type": "git",
"url": "https://github.com/valhalla/web-app"
},
"type": "module",
"scripts": {
"dev": "vite",
Expand All @@ -17,7 +23,7 @@
"lint": "eslint .",
"prettier": "prettier --write \"**/*.{json,md,scss,yaml,yml,js,jsx,ts,tsx}\"",
"prettier:check": "prettier --check \"**/*.{json,md,scss,yaml,yml,js,jsx,ts,tsx}\"",
"check": "yarn prettier:check && yarn lint",
"check": "npm run prettier:check && npm run lint",
"typecheck": "tsc --noEmit",
"deploy": "gh-pages -d build",
"prepare": "husky",
Expand Down