Add max duration #43
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build | |
on: | |
push: | |
branches: [ "main" ] | |
paths-ignore: | |
- README.md | |
concurrency: deploy | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
repository: UM-LPM/known_hosts | |
path: known_hosts | |
- name: Set known hosts | |
run: install -D -m 600 known_hosts/known_hosts ~/.ssh/known_hosts | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Build | |
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1 | |
with: | |
arguments: build | |
- name: Install | |
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1 | |
with: | |
arguments: installDist | |
- name: Deploy | |
env: | |
DIST: ${{ github.workspace }}/green/build/install/green/ | |
run: | | |
eval "$(ssh-agent)" | |
ssh-add - <<< "${{ secrets.SSHKEY }}" | |
rsync -rtz --delete "$DIST" 'green@green.lpm.feri.um.si:/home/green/green/' | |
ssh root@green.lpm.feri.um.si 'systemctl restart green' | |
- name: Tunnel | |
run: | | |
eval "$(ssh-agent)" | |
ssh-add - <<< "${{ secrets.SSHKEY }}" | |
ssh -fN -L 50051:localhost:50051 'green@green.lpm.feri.um.si' | |
- name: Test post deploy | |
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1 | |
with: | |
arguments: testPostDeploy |