Skip to content

Commit

Permalink
ci(preview): enable deploy previews and update d2-style
Browse files Browse the repository at this point in the history
  • Loading branch information
varl committed Aug 19, 2021
1 parent c3ef97d commit dcf6cf8
Show file tree
Hide file tree
Showing 3 changed files with 277 additions and 182 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/dhis2-preview-pr.yml
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 }}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"devDependencies": {
"@dhis2/cli-app-scripts": "^7.1.0",
"@dhis2/cli-style": "^9.0.1"
"@dhis2/cli-style": "^9.2.0"
},
"dependencies": {
"@dhis2/app-runtime": "^2.8.0",
Expand Down
Loading

0 comments on commit dcf6cf8

Please sign in to comment.