-
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.
Sync workflows with openlayers-base-packages
- Loading branch information
Showing
5 changed files
with
120 additions
and
56 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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Install | ||
description: Install pnpm dependencies | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Install pnpm | ||
uses: pnpm/action-setup@v4 | ||
with: | ||
version: 9 | ||
run_install: false | ||
|
||
- name: Install Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
cache: "pnpm" | ||
|
||
- name: Install dependencies | ||
shell: bash | ||
run: pnpm install --frozen-lockfile |
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
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 |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Preview PR | ||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- closed | ||
- reopened | ||
- synchronize | ||
|
||
jobs: | ||
wait: | ||
name: Wait for checks | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
steps: | ||
# This is a separate file that simply waits for the other checks to complete because | ||
# we don't want to run duplicate checks for pr + push events. | ||
# Checks and builds run on all branches (on _push_) but this workflow runs only on PR events. | ||
# If you know a smarter way, let us now. | ||
- name: Wait for other checks to succeed | ||
if: github.event.action != 'closed' | ||
uses: lewagon/[email protected] | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
check-name: "Build samples and documentation" | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
wait-interval: 10 | ||
|
||
deploy: | ||
name: Preview PR | ||
runs-on: ubuntu-latest | ||
concurrency: preview-${{ github.ref }} | ||
timeout-minutes: 5 | ||
needs: wait | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Download latest build artifact | ||
run: | | ||
WORKFLOW_RUN=$(gh run list -c ${{ github.event.pull_request.head.sha }} -w "test-and-build.yml" -e push --json databaseId --limit 1 | jq .[0].databaseId -r) | ||
echo "Latest workflow run: $WORKFLOW_RUN" | ||
mkdir site && cd site; | ||
echo "Downloading build artifact" | ||
gh run download $WORKFLOW_RUN -n build | ||
echo "Download successful:" | ||
ls -alh | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
|
||
- name: Deploy PR Preview | ||
uses: rossjrw/[email protected] | ||
with: | ||
source-dir: ./site/www/ |
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
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