diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..cb0009c6 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,25 @@ +name: Build +on: [pull_request] +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2.3.1 + with: + submodules: recursive + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v35.4.4 + + - 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 + diff --git a/.github/workflows/build_and_deploy.yml b/.github/workflows/build_and_deploy.yml deleted file mode 100644 index 460d3244..00000000 --- a/.github/workflows/build_and_deploy.yml +++ /dev/null @@ -1,64 +0,0 @@ -name: Build and Deploy -on: [push, pull_request] -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2.3.1 - with: - submodules: recursive - - - name: Get changed files - id: changed-files - uses: tj-actions/changed-files@v35.4.4 - - - 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 - if: ${{ github.event_name != 'pull_request' && steps.extract_branch.outputs.branch == 'master' }} - 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 - with: - submodules: recursive - if: ${{ github.event_name != 'pull_request' && steps.extract_branch.outputs.branch == 'master' }} - - name: Build - run: | - ./gradlew run - - name: Run yarn 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: Run yarn build - uses: borales/actions-yarn@v4 - with: - dir: 'website' - cmd: run build # will run `yarn test` command - if: ${{ github.event_name != 'pull_request' && steps.extract_branch.outputs.branch == 'master' }} - - name: Merge - run: | - cp -a output/. website/public/ - - name: Deploy - uses: JamesIves/github-pages-deploy-action@4.1.4 - with: - branch: gh-pages - folder: website/public - if: ${{ github.event_name != 'pull_request' && steps.extract_branch.outputs.branch == 'master' }} \ No newline at end of file diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 00000000..efa6c5b9 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,34 @@ +name: Build +on: + push: + branches: [ master ] +jobs: + deploy: + runs-on: ubuntu-latest + needs: build + steps: + - name: Checkout + uses: actions/checkout@v2.3.1 + with: + submodules: recursive + - name: Build + run: | + ./gradlew run + - name: Run yarn install + uses: borales/actions-yarn@v4 + with: + dir: 'website' + cmd: install # will run `yarn install` command + - name: Run yarn build + uses: borales/actions-yarn@v4 + with: + dir: 'website' + cmd: run build # will run `yarn test` command + - name: Merge + run: | + cp -a output/. website/public/ + - name: Deploy + uses: JamesIves/github-pages-deploy-action@4.1.4 + with: + branch: gh-pages + folder: website/public \ No newline at end of file