Sync data #9
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: Sync data | |
on: | |
schedule: | |
- cron: '17 5 * * *' | |
workflow_dispatch: | |
env: | |
FORCE_COLOR: 1 | |
jobs: | |
update-data: | |
name: Run data sync | |
env: | |
ANSIBLE_HOST_KEY_CHECKING: False | |
STAGING_HOST_IP_ADDRESS: '${{ secrets.STAGING_HOST_IP_ADDRESS }}' | |
STAGING_SSH_PRIVATE_KEY_PATH: '~/.ssh/nest_staging_private_key' | |
environment: staging | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Prepare SSH key | |
run: | | |
mkdir -m 700 ~/.ssh | |
echo "${{ secrets.STAGING_SSH_PRIVATE_KEY }}" > ${{ env.STAGING_SSH_PRIVATE_KEY_PATH }} | |
chmod 400 ${{ env.STAGING_SSH_PRIVATE_KEY_PATH }} | |
- name: Run make sync | |
working-directory: .github/ansible | |
run: ansible-playbook -i inventory.yaml staging/sync.yaml |