-
Notifications
You must be signed in to change notification settings - Fork 5
64 lines (62 loc) · 2.04 KB
/
CI.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Sandbox Code Batch Updater CI
on:
push:
branches: [ 'main' ]
pull_request:
branches: [ 'main' ]
repository_dispatch:
types: [ 'template-code-changes' ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build with Maven
run: mvn --show-version --batch-mode verify
update-sandboxes:
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up Git config
run: |
git config --global user.name "Sandbox 🤖"
git config --global user.email ${{ secrets.EMAIL }}
- name: Clone neo4j-graph-examples/template repo
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
run: |
git clone https://$GITHUB_TOKEN@github.com/neo4j-graph-examples/template/
- name: Run updater against sandboxes
env:
GITHUB_USERNAME: ${{ secrets.USERNAME }}
GITHUB_TOKEN: ${{ secrets.TOKEN }}
SANDBOX_CODE_SAMPLES_PATH: ${{ github.workspace }}/template
# the workflow has been triggered either by an event dispatch (DISPATCH_CONTEXT) or a regular commit (COMMIT)
CONTEXT_DISPATCH: ${{ toJson(github.event.client_payload) }}
CONTEXT_COMMIT: ${{ github.sha }}
run: >
mvn --show-version --batch-mode spring-boot:run -Dspring-boot.run.arguments=--logging.level.com.neo4j=TRACE