Skip to content

Updated the playground to support Langium 4.1 #288

Updated the playground to support Langium 4.1

Updated the playground to support Langium 4.1 #288

Workflow file for this run

name: Deploy PR previews
on:
pull_request_target:
types:
- opened
- synchronize
- reopened
- closed
concurrency: preview-${{ github.head_ref }}
defaults:
run:
shell: bash
jobs:
build-preview:
if: github.event_name == 'pull_request_target' && github.event.action != 'closed'
runs-on: ubuntu-latest
steps:
- name: Use Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: '18'
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Build
run: |
npm install
npm run build
- name: Upload artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: "site"
path: ./public
deploy-preview:
needs: build-preview
runs-on: ubuntu-latest
permissions:
pull-requests: write
environment:
name: pull-request-preview
url: ${{ steps.deployment.outputs.deployment-url }}
steps:
# checkout required for pr-preview-action to succeed,
# while the content will not be used
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Download the preview page
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: "site"
path: ./public
- uses: rossjrw/pr-preview-action@2fb559e4766555e23d07b73d313fe97c4f8c3cfe # v1.6.1
id: deployment
with:
source-dir: ./public
preview-branch: previews
umbrella-dir: pr-previews
deploy-repository: eclipse-langium/langium-previews
token: ${{ secrets.DEPLOY_PREVIEW_TOKEN }}
action: auto
# remove the preview page when the PR got closed
remove-preview:
if: github.event_name == 'pull_request_target' && github.event.action == 'closed'
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
# checkout required for pr-preview-action to succeed,
# while the content will not be used
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: rossjrw/pr-preview-action@2fb559e4766555e23d07b73d313fe97c4f8c3cfe # v1.6.1
id: deployment
with:
preview-branch: previews
umbrella-dir: pr-previews
deploy-repository: eclipse-langium/langium-previews
token: ${{ secrets.DEPLOY_PREVIEW_TOKEN }}
action: auto