mirror of
https://github.com/Instadapp/chains.git
synced 2024-07-29 22:37:19 +00:00
45 lines
1.4 KiB
YAML
45 lines
1.4 KiB
YAML
name: Build and Deploy
|
|
on: [push, pull_request]
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2.3.1
|
|
|
|
- name: Get changed files
|
|
id: changed-files
|
|
uses: tj-actions/changed-files@v35
|
|
|
|
- name: Check changed files
|
|
run: |
|
|
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
|
|
./gradlew clean run --args="verbose singleChainCheck $file"
|
|
done
|
|
|
|
- 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
|
|
- name: Checkout
|
|
uses: actions/checkout@v2.3.1
|
|
if: ${{ github.event_name != 'pull_request' && steps.extract_branch.outputs.branch == 'master' }}
|
|
- name: Build
|
|
run: |
|
|
./gradlew run
|
|
if: ${{ github.event_name != 'pull_request' && steps.extract_branch.outputs.branch == 'master' }}
|
|
- name: Deploy
|
|
uses: JamesIves/github-pages-deploy-action@4.1.4
|
|
with:
|
|
branch: gh-pages
|
|
folder: output
|
|
if: ${{ github.event_name != 'pull_request' && steps.extract_branch.outputs.branch == 'master' }} |