Skip to content

Commit

Permalink
Update deploy.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
VNxyz1 authored Nov 13, 2023
1 parent b0ae160 commit 8eeb829
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,19 @@ jobs:
working-directory: "./server"
- name: Create environment file
env:
HOST: ${{ if eq(github.ref, 'refs/heads/main') }}${{ secrets.PROD_NEO4J_HOST }}${{ else }}${{ secrets.DEV_NEO4J_HOST }}${{ endif }}
USERNAME: ${{ if eq(github.ref, 'refs/heads/main') }}${{ secrets.PROD_NEO4J_USERNAME }}${{ else }}${{ secrets.DEV_NEO4J_USERNAME }}${{ endif }}
PASSWORD: ${{ if eq(github.ref, 'refs/heads/main') }}${{ secrets.NEO4J_PASSWORD }}${{ else }}${{ secrets.DEV_NEO4J_PASSWORD }}${{ endif }}
run: |
sed -i -e '$a\' .env
echo NEO4J_HOST=$HOST >> .env
echo NEO4J_USERNAME=$USERNAME >> .env
echo NEO4J_PASSWORD=$PASSWORD >> .env
if [ "${{ github.ref }}" == "refs/heads/main" ]; then
HOST=${{ secrets.PROD_NEO4J_HOST }}
USERNAME=${{ secrets.PROD_NEO4J_USERNAME }}
PASSWORD=${{ secrets.PROD_NEO4J_PASSWORD }}
else
HOST=${{ secrets.DEV_NEO4J_HOST }}
USERNAME=${{ secrets.DEV_NEO4J_USERNAME }}
PASSWORD=${{ secrets.DEV_NEO4J_PASSWORD }}
fi
echo "NEO4J_HOST=$HOST" >> .env
echo "NEO4J_USERNAME=$USERNAME" >> .env
echo "NEO4J_PASSWORD=$PASSWORD" >> .env
working-directory: "./server"

- name: Create directory structure for deployment
Expand All @@ -64,6 +68,7 @@ jobs:
name: artifact
path: /home/runner/work/socinian-graph-dse/socinian-graph-dse/deploy.zip


deploy:
name: deploy to server
needs: [build]
Expand Down

0 comments on commit 8eeb829

Please sign in to comment.