X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=.github%2Fworkflows%2Fmaven.yml;h=2256c31a812fdffa66c6a422f5860ffa22258458;hb=11befdfe3947e25ea96cd6117246994757883b61;hp=d9ea203b366322a07ec6bbe2657f716a3dde1696;hpb=f9f8b605a8fb9e124d125fdc1a94f64b0aaf75f2;p=Mograsim.git diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index d9ea203b..2256c31a 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -3,7 +3,7 @@ name: Java CI on: [push] jobs: - build: + build-and-deploy: runs-on: ubuntu-latest @@ -19,5 +19,22 @@ jobs: uses: actions/setup-java@v1 with: java-version: 11 + - name: Cache Maven Dependencies + uses: actions/cache@v2.1.1 + with: + path: ~/.m2/repository + key: mograsim-maven-${{ hashFiles('**/pom.xml,**/MANIFEST.MF') }} + restore-keys: | + mograsim-maven- - name: Build with Maven run: mvn --batch-mode --errors --fail-at-end --show-version clean verify --file pom.xml + - name: Deploy to mograsim.net + env: + DEPLOY_KEY: ${{ secrets.DEPLOY_KEY}} + MOGRASIM_NET_HOST_PUBKEY: ${{ secrets.MOGRASIM_NET_HOST_PUBKEY }} + run: | + mkdir -p ~/.ssh + printenv DEPLOY_KEY > ~/.ssh/id_rsa_deploy + chmod 600 ~/.ssh/id_rsa_deploy + printenv MOGRASIM_NET_HOST_PUBKEY >> ~/.ssh/known_hosts + scp -i ~/.ssh/id_rsa_deploy -r releng/net.mograsim.plugin.updatesite/target/repository mgsdeploy@mograsim.net:/mograsim/testdeploy