-
Notifications
You must be signed in to change notification settings - Fork 153
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
4 changed files
with
117 additions
and
0 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
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,92 @@ | ||
name: Playroom | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- "**" | ||
|
||
env: # Set environment variables for every job and step in this workflow | ||
CLICOLOR: "1" # Enable colors for *NIX commands | ||
PY_COLORS: "1" # Enable colors for Python-based utilities | ||
FORCE_COLOR: "1" # Force colors in the terminal | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: write # for dependabot | ||
contents: write # for deploying to GitHub Pages on master | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Node | ||
uses: ./.github/actions/node | ||
|
||
- name: Compile design tokens | ||
run: yarn tokens build | ||
|
||
- name: Build tailwind | ||
run: yarn tailwind-preset build | ||
|
||
- name: Build components | ||
run: yarn components build | ||
|
||
- name: Build Playroom | ||
run: yarn components build:playroom | ||
|
||
- name: Get BRANCH_URL | ||
# do not run on master branch | ||
if: github.ref != 'refs/heads/master' | ||
env: | ||
BRANCH_NAME: ${{ github.head_ref }} | ||
run: echo "BRANCH_URL=$(sed -e 's/[^a-zA-Z0-9]/-/g' <<< ${BRANCH_NAME})" >> $GITHUB_ENV | ||
|
||
- name: Get DOMAIN | ||
if: github.ref != 'refs/heads/master' | ||
run: echo "DOMAIN=https://kiwicom-orbit-playroom-${BRANCH_URL}.surge.sh" >> $GITHUB_ENV | ||
|
||
- name: Deploy to staging | ||
if: github.ref != 'refs/heads/master' | ||
run: yarn components deploy:playroom ${DOMAIN} --token ${{ secrets.SURGE_TOKEN }} | ||
|
||
- name: Add comment to PR | ||
if: github.ref != 'refs/heads/master' | ||
uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
const commentBody = `Playroom staging is available at ${process.env.DOMAIN}`; | ||
const commentsList = await github.rest.issues.listComments({ | ||
issue_number: context.issue.number, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
}); | ||
const comment = commentsList.data.find((comment) => comment.body.includes(commentBody)); | ||
if (!comment) { | ||
github.rest.issues.createComment({ | ||
issue_number: context.issue.number, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
body: commentBody, | ||
}) | ||
} else { | ||
github.rest.issues.updateComment({ | ||
comment_id: comment.id, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
body: commentBody, | ||
}) | ||
} | ||
# - name: Deploy to production | ||
# # run on master branch | ||
# if: github.ref == 'refs/heads/master' | ||
# run: yarn components deploy:playroom --ci | ||
# env: | ||
# GH_TOKEN: ${{ github.actor }}:${{ secrets.GITHUB_TOKEN }} |
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,22 @@ | ||
name: SarkaTest | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- "**" | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: write # for dependabot | ||
contents: write # create commits and releases | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Node | ||
uses: ./.github/actions/node | ||
|
||
- name: Ref test | ||
run: echo $GITHUB_REF |
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