-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(preview): enable deploy previews and update d2-style
- Loading branch information
Showing
3 changed files
with
277 additions
and
182 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,51 @@ | ||
name: 'dhis2: pr preview' | ||
|
||
# Requirements: | ||
# | ||
# - Org secrets: | ||
# DHIS2_BOT_NETLIFY_TOKEN | ||
# DHIS2_BOT_GITHUB_TOKEN | ||
# - Repo secrets: | ||
# NETLIFY_SITE_ID | ||
# - Customize the 'jobs.build.steps.netlify-deploy.publish-dir' property | ||
|
||
on: | ||
pull_request: | ||
|
||
concurrency: | ||
group: ${{ github.workflow}}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
preview: | ||
runs-on: ubuntu-latest | ||
if: "!github.event.push.repository.fork && github.actor != 'dependabot[bot]'" | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: 12.x | ||
|
||
- uses: c-hive/gha-yarn-cache@v1 | ||
- run: yarn install --frozen-lockfile | ||
|
||
- name: Build | ||
run: yarn d2-app-scripts build --standalone | ||
|
||
- name: Deploy | ||
id: netlify-deploy | ||
uses: nwtgck/[email protected] | ||
timeout-minutes: 1 | ||
with: | ||
github-token: ${{ secrets.DHIS2_BOT_GITHUB_TOKEN }} | ||
deploy-message: ${{ github.event.pull_request.title }} | ||
enable-pull-request-comment: true | ||
enable-commit-comment: false | ||
alias: pr-${{ github.event.number }} | ||
# customize according to project needs | ||
publish-dir: 'build/app' | ||
env: | ||
# org secret | ||
NETLIFY_AUTH_TOKEN: ${{ secrets.DHIS2_BOT_NETLIFY_TOKEN }} | ||
# repo secret | ||
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} |
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
Oops, something went wrong.