Skip to content

Commit

Permalink
Update anchor-deploy.yaml
Browse files Browse the repository at this point in the history
Signed-off-by: Ravencodess <[email protected]>
  • Loading branch information
Ravencodess authored Aug 15, 2024
1 parent 89dd360 commit bc315ba
Showing 1 changed file with 51 additions and 7 deletions.
58 changes: 51 additions & 7 deletions .github/workflows/anchor-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- completed

jobs:
deploy_to_dev:
deploy_to_java:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest

Expand All @@ -31,8 +31,8 @@ jobs:
- name: Copy Artifacts to server
run: |
sudo apt update && sudo apt install sshpass -y
sshpass -p ${{ secrets.PASSWORD }} scp -o StrictHostKeyChecking=no boilerplate.tar.gz .env.java ${{ secrets.USERNAME }}@${{ secrets.HOST }}:/tmp/
rm -f boilerplate.tar.gz .env
sshpass -p ${{ secrets.PASSWORD }} scp -o StrictHostKeyChecking=no boilerplate.tar.gz .env.java ${{ secrets.USERNAME }}@${{ secrets.HOST }}:/tmp/java
rm -f boilerplate.tar.gz .env.java
- name: Deploy on server
uses: appleboy/ssh-action@master
Expand All @@ -41,9 +41,53 @@ jobs:
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
script: |
cd boilerplate
cd boilerplate-frontend
rm -rf *
tar -xzf /tmp/boilerplate.tar.gz
mv /tmp/.env.java .env
rm -f /tmp/boilerplate.tar.gz
tar -xzf /tmp/java/boilerplate.tar.gz
mv /tmp/java/.env.java .env
rm -f /tmp/java/boilerplate.tar.gz
cp -r .next/standalone/* .
pm2 restart java-boilerplate --update-env
deploy_to_python:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest

environment:
name: "anchor-python"
url: ${{ vars.URL }}

steps:
- name: Download build artifact
uses: actions/download-artifact@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.id }}
name: boilerplate-build
path: .

- name: Decode and create .env file
run: |
echo ${{ secrets.ENV }} | base64 -d > .env.python
- name: Copy Artifacts to server
run: |
sudo apt update && sudo apt install sshpass -y
sshpass -p ${{ secrets.PASSWORD }} scp -o StrictHostKeyChecking=no boilerplate.tar.gz .env.python ${{ secrets.USERNAME }}@${{ secrets.HOST }}:/tmp/python
rm -f boilerplate.tar.gz .env.python
- name: Deploy on server
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
script: |
cd boilerplate-frontend
rm -rf *
tar -xzf /tmp/python/boilerplate.tar.gz
mv /tmp/python/.env.java .env
rm -f /tmp/python/boilerplate.tar.gz
cp -r .next/standalone/* .
pm2 restart python-boilerplate --update-env

0 comments on commit bc315ba

Please sign in to comment.