Fixed the scp command
[Mograsim.git] / .github / workflows / maven.yml
1 name: Java CI
2
3 on: [push]
4
5 jobs:
6   build-and-deploy:
7
8     runs-on: ubuntu-latest
9
10     steps:
11     - uses: actions/checkout@v2
12     - name: Checkout submodules # See https://github.com/actions/checkout#Checkout-submodules
13       shell: bash
14       run: |
15          auth_header="$(git config --local --get http.https://github.com/.extraheader)"
16          git submodule sync --recursive
17          git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
18     - name: Set up JDK 11
19       uses: actions/setup-java@v1
20       with:
21         java-version: 11
22     - name: Cache Maven Dependencies
23       uses: actions/cache@v2.1.1
24       with:
25         path: ~/.m2/repository
26         key: mograsim-maven-${{ hashFiles('**/pom.xml,**/MANIFEST.MF') }}
27         restore-keys: |
28           mograsim-maven-
29     - name: Build with Maven
30       run: mvn --batch-mode --errors --fail-at-end --show-version clean verify --file pom.xml
31     - name: Deploy to mograsim.net
32       env:
33         DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }}
34       run: |
35         mkdir -p ~/.ssh
36         echo "${DEPLOY_TOKEN}" > ~/.ssh/id_rsa_deploy
37         chmod 600 ~/.ssh/id_rsa_deploy
38         scp -i ~/.ssh/id_rsa_deploy -r releng/net.mograsim.plugin.updatesite/target/repository mograsim.net:mograsim/testdeploy