-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #117 from wultra/issues/scp-deploy
Add GitHub action for SCP deploy
- Loading branch information
Showing
1 changed file
with
58 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
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 | ||
env: | ||
INTERNAL_USERNAME: ${{ secrets.JFROG_USERNAME }} | ||
INTERNAL_PASSWORD: ${{ secrets.JFROG_PASSWORD }} | ||
- name: Retrieve the certificate and store it to a file | ||
env: | ||
SCP_CERTIFICATE: ${{ secrets.SCP_CERTIFICATE }} | ||
run: | | ||
echo $SCP_CERTIFICATE > cert.pem | ||
- name: Deploy enrollment-server.war | ||
shell: bash | ||
env: | ||
SCP_USERNAME: ${{ secrets.SCP_USERNAME }} | ||
SCP_HOST: ${{ secrets.SCP_HOST }} | ||
run: | | ||
scp -i cert.pem enrollment-server-wultra-*.war $SCP_USERNAME@$SCP_HOST:/opt/apache-tomcat/webapps/enrollment-server.war | ||
- name: Deploy enrollment-server-onboarding.war | ||
shell: bash | ||
env: | ||
SCP_USERNAME: ${{ secrets.SCP_USERNAME }} | ||
SCP_HOST: ${{ secrets.SCP_HOST }} | ||
run: | | ||
scp -i cert.pem enrollment-server-onboarding-wultra-*.war $SCP_USERNAME@$SCP_HOST:/opt/apache-tomcat/webapps/enrollment-server-onboarding.war | ||
- name: Deploy enrollment-server.war mock | ||
shell: bash | ||
env: | ||
SCP_USERNAME: ${{ secrets.SCP_USERNAME }} | ||
SCP_HOST: ${{ secrets.SCP_HOST }} | ||
run: | | ||
scp -i cert.pem enrollment-server-wultra-*.war $SCP_USERNAME@$SCP_HOST:/opt/apache-tomcat/webapps/enrollment-server-mock.war | ||
- name: Deploy enrollment-server-onboarding.war mock | ||
shell: bash | ||
env: | ||
SCP_USERNAME: ${{ secrets.SCP_USERNAME }} | ||
SCP_HOST: ${{ secrets.SCP_HOST }} | ||
run: | | ||
scp -i cert.pem enrollment-server-onboarding-wultra-*.war $SCP_USERNAME@$SCP_HOST:/opt/apache-tomcat/webapps/enrollment-server-onboarding-mock.war |