Skip to content

Import data in production #1706

Import data in production

Import data in production #1706

name: Import data in production
on:
repository_dispatch:
types: [import-data-production]
schedule:
- cron: '0 4 * * *'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: develop
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install Dependencies
run: bun install --frozen-lockfile
- name: Import GroupeParlementaire
run: bun start -g
env:
SUPABASE_URL: ${{ secrets.SUPABASE_URL_PRODUCTION }}
SUPABASE_KEY: ${{ secrets.SUPABASE_KEY_PRODUCTION }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_NOTIFICATION: ${{ secrets.SLACK_NOTIFICATION }}
NOSDEPUTES_BASE_URL: ${{ secrets.NOSDEPUTES_BASE_URL_PROD }}
SUPABASE_ENV: Production
- name: Import Depute
run: bun start -d
env:
SUPABASE_URL: ${{ secrets.SUPABASE_URL_PRODUCTION }}
SUPABASE_KEY: ${{ secrets.SUPABASE_KEY_PRODUCTION }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_NOTIFICATION: ${{ secrets.SLACK_NOTIFICATION }}
NOSDEPUTES_BASE_URL: ${{ secrets.NOSDEPUTES_BASE_URL_PROD }}
SUPABASE_ENV: Production
# - name: Import Activite
# run: bun start -a
# env:
# SUPABASE_URL: ${{ secrets.SUPABASE_URL_PRODUCTION }}
# SUPABASE_KEY: ${{ secrets.SUPABASE_KEY_PRODUCTION }}
# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
# SLACK_NOTIFICATION: ${{ secrets.SLACK_NOTIFICATION }}
# NOSDEPUTES_BASE_URL: ${{ secrets.NOSDEPUTES_BASE_URL_PROD }}
# SUPABASE_ENV: Production
- name: Import OrganismeParlementaire
run: bun start -o
env:
SUPABASE_URL: ${{ secrets.SUPABASE_URL_PRODUCTION }}
SUPABASE_KEY: ${{ secrets.SUPABASE_KEY_PRODUCTION }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_NOTIFICATION: ${{ secrets.SLACK_NOTIFICATION }}
NOSDEPUTES_BASE_URL: ${{ secrets.NOSDEPUTES_BASE_URL_PROD }}
SUPABASE_ENV: Production
- name: Import Deputes_OrganismeParlementaire
run: bun start -p
env:
SUPABASE_URL: ${{ secrets.SUPABASE_URL_PRODUCTION }}
SUPABASE_KEY: ${{ secrets.SUPABASE_KEY_PRODUCTION }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_NOTIFICATION: ${{ secrets.SLACK_NOTIFICATION }}
NOSDEPUTES_BASE_URL: ${{ secrets.NOSDEPUTES_BASE_URL_PROD }}
SUPABASE_ENV: Production
- name: Send message to Discord
uses: MineBartekSA/discord-webhook@v2
with:
webhook: ${{ secrets.DISCORD_WEBHOOK_URL }}
username: 'GitHub Actions'
avatar_url: https://avatars.githubusercontent.com/u/44036562?s=200&v=4
embed: |
{
"title": "Nucleus Production",
"description": ":white_check_mark: Data imported into Production!",
"color": 8311585
}