Skip to content

-File- .env Deploy

-File- .env Deploy #1

Workflow file for this run

name : Setup .env file
on:
workflow_dispatch
jobs:
deploy-neccessary-file:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Make envfile
uses: SpicyPizza/create-envfile@v1
with:
envkey_ELASTIC_USERNAME: ${{ secrets.ELASTIC_USERNAME }}
envkey_ELASTIC_PASSWORD: ${{ secrets.ELASTIC_PASSWORD }}
envkey_AUTH_DB_NAME: "Authen"
envkey_AUTH_DB_USER: ${{ secrets.AUTH_DB_USER }}
envkey_AUTH_DB_PASSWORD: ${{ secrets.AUTH_DB_PASSWORD }}
envkey_JWT_KEY: ${{ secrets.JWT_KEY }}
envkey_SENDER_EMAIL: "[email protected]"
envkey_SENDER_PASSWORD: ${{ secrets.SENDER_PASSWORD }}
envkey_LINK_URL: "https://search.dhammanava.net"
envkey_SUPER_ADMIN_USERNAME: ${{ secrets.SUPER_ADMIN_USERNAME }}
envkey_SUPER_ADMIN_PASSWORD: ${{ secrets.SUPER_ADMIN_PASSWORD }}
envkey_SUPER_ADMIN_EMAIL: ${{ secrets.SUPER_ADMIN_EMAIL }}
envkey_ADMIN_PASSWORD: ${{ secrets.ADMIN_PASSWORD }}
envkey_ADMIN_EMAIL: ${{ secrets.ADMIN_EMAIL }}
envkey_USER_PASSWORD: ${{ secrets.USER_PASSWORD }}
envkey_USER_EMAIL: ${{ secrets.USER_EMAIL }}
envkey_DATA_MNGMNT_DB_USER: ${{ secrets.DATA_MNGMNT_DB_USER }}
envkey_DATA_MNGMNT_DB_PASSWORD: ${{ secrets.DATA_MNGMNT_DB_PASSWORD }}
file_name: .env
- name: Set up SSH
run: |
mkdir -p ~/.ssh
echo "${{ secrets.LINUX_PRIVATE_KEY_BASE64 }}" | base64 -d > ~/.ssh/id_rsa
chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -t rsa ${{ secrets.LINUX_HOST }} >> ~/.ssh/known_hosts
- name : Delete Exisiting .env
run: |
ssh -i ~/.ssh/id_rsa ${{ secrets.LINUX_USERNAME }}@${{ secrets.LINUX_HOST }} "rm -rf ~/dhammanava-search/.env"
- name: Copy .env to server
run: |
scp -i ~/.ssh/id_rsa .env ${{ secrets.LINUX_USERNAME }}@${{ secrets.LINUX_HOST }}:~/dhammanava-search