forked from PrismarineJS/prismarine-web-client
-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
20 additions
and
4 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 |
---|---|---|
|
@@ -6,22 +6,38 @@ env: | |
on: | ||
issue_comment: | ||
types: [created] | ||
pull_request: | ||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
# todo skip already created deploys on that commit | ||
if: >- | ||
github.event.issue.pull_request != '' && | ||
( | ||
contains(github.event.comment.body, '/deploy') | ||
github.event.issue.pull_request != '' && | ||
( | ||
contains(github.event.comment.body, '/deploy') | ||
) | ||
) || | ||
( | ||
github.event_name == 'pull_request' && ( | ||
env.AUTO_DEPLOY_PRS contains $'\n' + toString(github.event.pull_request.number) + $'\n' || | ||
startsWith(env.AUTO_DEPLOY_PRS, toString(github.event.pull_request.number) + $'\n') || | ||
endsWith(env.AUTO_DEPLOY_PRS, $'\n' + toString(github.event.pull_request.number)) || | ||
env.AUTO_DEPLOY_PRS == toString(github.event.pull_request.number) | ||
) | ||
) | ||
permissions: | ||
pull-requests: write | ||
steps: | ||
- name: Checkout | ||
- name: Checkout PR (comment) | ||
uses: actions/checkout@v2 | ||
if: github.event_name == 'issue_comment' | ||
with: | ||
ref: refs/pull/${{ github.event.issue.number }}/head | ||
- name: Checkout PR (pull_request) | ||
uses: actions/checkout@v2 | ||
if: github.event_name == 'pull_request' | ||
|
||
- run: npm i -g [email protected] | ||
- uses: actions/setup-node@v4 | ||
with: | ||
|
@@ -59,7 +75,7 @@ jobs: | |
id: alias | ||
env: | ||
ALIASES: ${{ env.ALIASES }} | ||
PULL_URL: ${{ github.event.issue.pull_request.url }} | ||
PULL_URL: ${{ github.event.issue.pull_request.url || github.event.pull_request.url }} | ||
- name: Set deployment alias | ||
if: ${{ steps.alias.outputs.alias != '' && steps.alias.outputs.alias != 'mcraft.fun' && steps.alias.outputs.alias != 's.mcraft.fun' }} | ||
run: vercel alias set ${{ steps.deploy.outputs.stdout }} ${{ steps.alias.outputs.alias }} --token=${{ secrets.VERCEL_TOKEN }} --scope=zaro |