2021-07-04 23:04:28 +00:00
|
|
|
name: Build and Deploy
|
2021-07-05 12:02:31 +00:00
|
|
|
on: [push, pull_request]
|
2021-07-04 23:04:28 +00:00
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2.3.1
|
2023-01-23 04:18:35 +00:00
|
|
|
with:
|
|
|
|
submodules: recursive
|
2021-07-04 23:04:28 +00:00
|
|
|
|
2023-01-11 07:34:59 +00:00
|
|
|
- name: Get changed files
|
|
|
|
id: changed-files
|
2023-01-23 04:18:35 +00:00
|
|
|
uses: tj-actions/changed-files@v35.4.4
|
2023-01-11 07:34:59 +00:00
|
|
|
|
|
|
|
- name: Check changed files
|
|
|
|
run: |
|
|
|
|
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
|
|
|
|
./gradlew clean run --args="verbose singleChainCheck $file"
|
|
|
|
done
|
|
|
|
|
2021-07-04 23:04:28 +00:00
|
|
|
- name: Build
|
|
|
|
run: |
|
|
|
|
./gradlew run
|
|
|
|
|
|
|
|
# deploy to github pages only when on master
|
|
|
|
deploy:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: build
|
|
|
|
steps:
|
|
|
|
- name: Extract branch name
|
|
|
|
shell: bash
|
|
|
|
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF##*/})"
|
|
|
|
id: extract_branch
|
2023-01-23 04:18:35 +00:00
|
|
|
- name: Checkout
|
2021-07-04 23:16:00 +00:00
|
|
|
uses: actions/checkout@v2.3.1
|
2023-01-23 04:18:35 +00:00
|
|
|
with:
|
|
|
|
submodules: recursive
|
|
|
|
if: ${{ github.event_name != 'pull_request' && steps.extract_branch.outputs.branch == 'master' }}
|
|
|
|
- name: Run install
|
|
|
|
uses: borales/actions-yarn@v4
|
|
|
|
with:
|
|
|
|
dir: 'website'
|
|
|
|
cmd: install # will run `yarn install` command
|
|
|
|
if: ${{ github.event_name != 'pull_request' && steps.extract_branch.outputs.branch == 'master' }}
|
|
|
|
- name: Test the app
|
|
|
|
uses: borales/actions-yarn@v4
|
|
|
|
with:
|
|
|
|
dir: 'website'
|
|
|
|
cmd: run build # will run `yarn test` command
|
2021-07-05 12:02:31 +00:00
|
|
|
if: ${{ github.event_name != 'pull_request' && steps.extract_branch.outputs.branch == 'master' }}
|
2021-07-04 23:04:28 +00:00
|
|
|
- name: Deploy
|
|
|
|
uses: JamesIves/github-pages-deploy-action@4.1.4
|
|
|
|
with:
|
|
|
|
branch: gh-pages
|
2023-01-23 04:18:35 +00:00
|
|
|
folder: website/public
|
|
|
|
if: ${{ github.event_name != 'pull_request' && steps.extract_branch.outputs.branch == 'master' }}
|