Use vars for publicly available args #18
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
# deploy to prod | |
# for easy changes to python app or data processing this should work | |
# if database migrations need to be applied they will need to be done manually | |
name: deploy-to-prod | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- "processing/miscellaneous/" | |
- "*.md" | |
jobs: | |
deploy: | |
name: Deploy to prod env | |
runs-on: ubuntu-latest | |
steps: | |
- name: Configure SSH | |
run: | | |
mkdir -p ~/.ssh | |
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519 && chmod 600 ~/.ssh/id_ed25519 | |
echo "${{ vars.SSH_KNOWN_HOSTS }}" > ~/.ssh/known_hosts | |
echo "Host remote | |
User ${{ vars.SSH_USER }} | |
HostName ${{ vars.SSH_HOST }} | |
Port ${{ vars.SSH_PORT }} | |
IdentityFile ~/.ssh/id_ed25519 | |
" > ~/.ssh/config | |
- name: Deploy on remote | |
run: ssh remote |