Skip to content

Commit

Permalink
Merge pull request #1077 from wultra/issues/scp-deploy
Browse files Browse the repository at this point in the history
Add GitHub action for SCP deploy
  • Loading branch information
banterCZ authored Oct 17, 2023
2 parents 16c4242 + ab58e79 commit ff3228a
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/scp-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Run SCP deploy

on:
workflow_dispatch:

jobs:
scp-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
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
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 powerauth-java-server.war
shell: bash
run: |
scp -i ~/.ssh/id_rsa **/target/powerauth-java-server-*.war ${{ secrets.SCP_USERNAME }}@${{ secrets.SCP_HOST }}:/opt/apache-tomcat/webapps/powerauth-java-server.war
- name: Deploy powerauth-admin.war
shell: bash
run: |
scp -i ~/.ssh/id_rsa **/target/powerauth-admin-*.war ${{ secrets.SCP_USERNAME }}@${{ secrets.SCP_HOST }}:/opt/apache-tomcat/webapps/powerauth-admin.war

0 comments on commit ff3228a

Please sign in to comment.