Skip to content

Sync Artsdata ids with CMS entities #79

Sync Artsdata ids with CMS entities

Sync Artsdata ids with CMS entities #79

name: Sync Artsdata ids with CMS entities
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *' # Runs every day at 12:00 AM UTC
jobs:
main:
runs-on: ubuntu-latest
env:
PRIVATE_KEY: ${{ secrets.AWS_LIGHTSAIL_ACCESS_KEY_PRODUCTION}}
HOSTNAME : ${{ vars.PRODUCTION_SERVER_7_IP}}
USER_NAME : ${{ vars.PRODUCTION_SERVER_7_USER_NAME }}
PRODUCTION_DATABASE_URL : ${{ secrets.PRODUCTION_DATABASE_URL }}
DD_API_KEY : ${{ secrets.DATA_DOG_CLIENT_KEY }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Copy directory to AWS instance
run: |
echo "$PRIVATE_KEY" > private_key && chmod 600 private_key
scp -o StrictHostKeyChecking=no -i private_key -r ./script/sync-artsdata-ids/* ${USER_NAME}@${HOSTNAME}:./application/scripts/
- name: Run reconcile-entities-in-cms.py
run: |
echo "$PRIVATE_KEY" > private_key && chmod 600 private_key
ssh -o StrictHostKeyChecking=no -i private_key ${USER_NAME}@${HOSTNAME} "cd ./application/scripts/ ;DD_SITE="datadoghq.com" DD_API_KEY="${DD_API_KEY}" ./venv/bin/python ./sync-artsdata-ids.py ${PRODUCTION_DATABASE_URL}"