Skip to content

Commit

Permalink
fix: Outdated path crates/rome_playground -> website/playground (rome…
Browse files Browse the repository at this point in the history
…#2377)

* fix: Outdated path crates/rome_playground -> website/playground

* fix: Removed path condition for deploy_playground.yml. We want to build even if
playground repo isn't changed

* fix: re-added paths but with crates this time

* fix: Removed unnecessary wasm-pack command. Also trying to fix url creation
  • Loading branch information
Nicholas Yang authored Apr 8, 2022
1 parent ab80eea commit 73452bd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/deploy_playground.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
workflow_dispatch:
pull_request:
paths:
- "crates"
- "website/playground"
branches:
- main
Expand All @@ -23,7 +24,6 @@ jobs:
node-version: '14'
- run: npm install --prefix website/playground
- uses: jetli/[email protected]
- run: wasm-pack build website/playground --target web --release
- run: npm run build --prefix website/playground -- --base=/$GITHUB_SHA/
- name: Publish
uses: jakejarvis/s3-sync-action@master
Expand All @@ -34,6 +34,13 @@ jobs:
SOURCE_DIR: 'website/playground/dist' # optional: defaults to entire repository
DEST_DIR: $GITHUB_SHA

- name: Set Playground URL
if: github.event_name == "pull_request"
id: url
run: |
url="[Playground for commit](http://play.rome.tools.s3-website-us-east-1.amazonaws.com/${{ GITHUB_SHA }}/index.html)"
echo "::set-output name=url::$url"
- name: Get the PR number
if: github.event_name == 'pull_request'
id: pr-number
Expand All @@ -54,7 +61,7 @@ jobs:
with:
comment-id: ${{ steps.previous-comment.outputs.comment-id }}
body: |
[Playground link](http://play.rome.tools.s3-website-us-east-1.amazonaws.com/$GITHUB_SHA/index.html)
${{ steps.url.outputs.url }}
edit-mode: replace

- name: Write a new comment
Expand All @@ -64,6 +71,6 @@ jobs:
with:
issue-number: ${{ steps.pr-number.outputs.pr }}
body: |
[Playground link](http://play.rome.tools.s3-website-us-east-1.amazonaws.com/$GITHUB_SHA/index.html)
${{ steps.url.outputs.url }}
7 changes: 3 additions & 4 deletions .github/workflows/deploy_playground_on_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,14 @@ jobs:
- uses: actions/setup-node@v2
with:
node-version: '14'
- run: npm install --prefix crates/rome_playground
- run: npm install --prefix website/playground
- uses: jetli/[email protected]
- run: wasm-pack build crates/rome_playground --target web --release
- run: npm run build --prefix crates/rome_playground
- run: npm run build --prefix website/playground
- name: Publish
uses: jakejarvis/s3-sync-action@master
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
SOURCE_DIR: 'crates/rome_playground/dist' # optional: defaults to entire repository
SOURCE_DIR: 'website/playground/dist' # optional: defaults to entire repository

0 comments on commit 73452bd

Please sign in to comment.