-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (50 loc) · 1.79 KB
/
main.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
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
env:
# Are we performing a full deploy cycle?
deploy: ${{ github.ref == 'refs/heads/main' && (github.event_name == 'push' || github.event_name == 'rebuild' || github.event_name == 'workflow_dispatch') }}
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Setup java
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'
- name: Checkout
uses: actions/checkout@v3
- name: Build with Maven
run: mvn clean install
- if: env.deploy == 'true'
name: Setup SSH
uses: kielabokkie/ssh-key-and-known-hosts-action@v1
with:
# Private key required to access the host
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
# Hostname or IP to add to the known hosts file
ssh-host: ${{ secrets.ROBOSTAR_WEB_HOST }}
- if: env.deploy == 'true'
name: Making shell scripts executable
run: chmod +x upload.sh version.sh
- if: env.deploy == 'true'
name: Uploading update site
run: ./upload.sh
env:
ROBOSTAR_WEB_ROOT: ${{ secrets.ROBOSTAR_WEB_ROOT }}
ROBOSTAR_WEB_USER: ${{ secrets.ROBOSTAR_WEB_USER }}
ROBOSTAR_WEB_HOST: ${{ secrets.ROBOSTAR_WEB_HOST }}
- if: env.deploy == 'true'
name: Recompile Textual Editor
# v2 is not authorised for use in RoboStar actions yet
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.ROBOSTAR_GITHUB_ACTIONS_TOKEN }}
repository: UoY-RoboStar/robocert-textual
event-type: rebuild
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'