Skip to content
Merged
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
49 changes: 49 additions & 0 deletions .github/workflows/website-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Open ohm-website PR
on:
workflow_run:
workflows: ["Release to npm"]
types: [completed]
workflow_dispatch:
inputs:
version:
description: 'map-styles version (empty = version in package.json)'
required: false

jobs:
website-pr:
if: github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: staging

- name: Get version
run: |
V="${{ inputs.version }}"
[ -z "$V" ] && V=$(node -p "require('./package.json').version")
echo "VERSION=$V" >> "$GITHUB_ENV"

- uses: actions/checkout@v4
with:
repository: OpenHistoricalMap/ohm-website
ref: staging
token: ${{ secrets.OHM_WEBSITE_TOKEN }}
path: ohm-website

- name: Update map-styles
working-directory: ohm-website
run: |
for i in $(seq 1 30); do npm view "@openhistoricalmap/map-styles@${VERSION}" version && break; sleep 10; done
yarn add "@openhistoricalmap/map-styles@^${VERSION}" --ignore-scripts

- uses: peter-evans/create-pull-request@v7
with:
path: ohm-website
token: ${{ secrets.OHM_WEBSITE_TOKEN }}
base: staging
branch: map-styles-${{ env.VERSION }}
add-paths: package.json,yarn.lock
commit-message: Update map-styles to ${{ env.VERSION }}
title: Update map-styles to ${{ env.VERSION }}
body: After merge, update `OPENHISTORICALMAP_WEBSITE_GITSHA` in ohm-deploy.
Loading