From 908ee257af259b946c772173fc5dcf66badbc2c5 Mon Sep 17 00:00:00 2001 From: Martin Korbel Date: Mon, 2 Dec 2024 12:42:51 +0100 Subject: [PATCH] Fix #1149 Add pipeline to deploy to dev via SCP --- .github/workflows/scp_deploy.yml | 35 ++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/scp_deploy.yml diff --git a/.github/workflows/scp_deploy.yml b/.github/workflows/scp_deploy.yml new file mode 100644 index 00000000..3ace90fe --- /dev/null +++ b/.github/workflows/scp_deploy.yml @@ -0,0 +1,35 @@ +name: Run SCP deploy + +on: + workflow_dispatch: + +jobs: + scp-deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 21 + uses: actions/setup-java@v4 + with: + java-version: 21 + distribution: 'temurin' + server-id: jfrog-central + server-username: INTERNAL_USERNAME + server-password: INTERNAL_PASSWORD + cache: maven + - name: Run Maven Package Step + run: | + mvn -B -U package -Dmaven.test.skip=true -DuseInternalRepo=true + env: + INTERNAL_USERNAME: ${{ secrets.JFROG_USERNAME }} + INTERNAL_PASSWORD: ${{ secrets.JFROG_PASSWORD }} + - name: Set up SSH key + run: | + mkdir -p ~/.ssh + echo "${{ secrets.SCP_CERTIFICATE }}" > ~/.ssh/id_rsa + chmod 600 ~/.ssh/id_rsa + ssh-keyscan -t rsa ${{ secrets.SCP_HOST }} >> ~/.ssh/known_hosts + - name: Deploy enrollment-server.war + shell: bash + run: | + scp -i ~/.ssh/id_rsa **/target/enrollment-server-*.war ${{ secrets.SCP_USERNAME }}@${{ secrets.SCP_HOST }}:/opt/apache-tomcat/webapps/enrollment-server.war \ No newline at end of file