forked from ethereum-lists/chains
-
Notifications
You must be signed in to change notification settings - Fork 1
35 lines (33 loc) · 1.05 KB
/
build_and_deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: Build and Deploy
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
- 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/[email protected]
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/[email protected]
with:
branch: gh-pages
folder: output
if: ${{ github.event_name != 'pull_request' && steps.extract_branch.outputs.branch == 'master' }}