Deploy contribution tool across different hosts (#172) #87
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
name: Deploy on Production | |
on: | |
push: | |
branches: [main] | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
env: | |
ENV: production | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
ref: ${{ github.event.pull_request.head.sha }} | |
- run: git checkout HEAD | |
# Enable deployment from github actions https://zellwk.com/blog/github-actions-deploy/ | |
- name: Install SSH key | |
uses: shimataro/ssh-key-action@v2 | |
with: | |
key: ${{ secrets.SSH_GITHUB_ACTIONS_PRIVATE_KEY }} # generate with ssh-keygen -t rsa -b 4096 -C "[email protected]" | |
known_hosts: ${{ secrets.SSH_KNOWN_HOSTS }} # generate with ssh-keyscan -H 51.89.231.68 | |
- run: echo "${{ secrets.ANSIBLE_VAULT_PASSWORD }}" > vault.key # Same as OpenTermsArchive.org | |
- run: pip install --upgrade setuptools | |
- run: pip install ansible==2.10.7 | |
- run: ansible-galaxy collection install community.general:==1.3.5 | |
- run: ansible-galaxy install -r ops/requirements.yml | |
- name: Deploy on production | |
run: npm run deploy:production |