Import data in staging #1573
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: Import data in staging | |
on: | |
repository_dispatch: | |
types: [import-data-staging] | |
schedule: | |
- cron: '0 4 * * *' | |
env: | |
GITHUB_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
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_STAGING }} | |
SUPABASE_KEY: ${{ secrets.SUPABASE_KEY_STAGING }} | |
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} | |
DISCORD_NOTIFICATION: ${{ secrets.DISCORD_NOTIFICATION }} | |
NOSDEPUTES_BASE_URL: ${{ secrets.NOSDEPUTES_BASE_URL_STAGING }} | |
SUPABASE_ENV: Staging | |
GITHUB_RUN_URL: ${{ env.GITHUB_RUN_URL }} | |
- name: Import Depute | |
run: bun start -d | |
env: | |
SUPABASE_URL: ${{ secrets.SUPABASE_URL_STAGING }} | |
SUPABASE_KEY: ${{ secrets.SUPABASE_KEY_STAGING }} | |
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} | |
DISCORD_NOTIFICATION: ${{ secrets.DISCORD_NOTIFICATION }} | |
NOSDEPUTES_BASE_URL: ${{ secrets.NOSDEPUTES_BASE_URL_STAGING }} | |
SUPABASE_ENV: Staging | |
GITHUB_RUN_URL: ${{ env.GITHUB_RUN_URL }} | |
# - name: Import Activite | |
# run: bun start -a | |
# env: | |
# SUPABASE_URL: ${{ secrets.SUPABASE_URL_STAGING }} | |
# SUPABASE_KEY: ${{ secrets.SUPABASE_KEY_STAGING }} | |
# DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} | |
# DISCORD_NOTIFICATION: ${{ secrets.DISCORD_NOTIFICATION }} | |
# NOSDEPUTES_BASE_URL: ${{ secrets.NOSDEPUTES_BASE_URL_STAGING }} | |
# SUPABASE_ENV: Staging | |
# GITHUB_RUN_URL: ${{ env.GITHUB_RUN_URL }} | |
- name: Import OrganismeParlementaire | |
run: bun start -o | |
env: | |
SUPABASE_URL: ${{ secrets.SUPABASE_URL_STAGING }} | |
SUPABASE_KEY: ${{ secrets.SUPABASE_KEY_STAGING }} | |
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} | |
DISCORD_NOTIFICATION: ${{ secrets.DISCORD_NOTIFICATION }} | |
NOSDEPUTES_BASE_URL: ${{ secrets.NOSDEPUTES_BASE_URL_STAGING }} | |
SUPABASE_ENV: Staging | |
GITHUB_RUN_URL: ${{ env.GITHUB_RUN_URL }} | |
- name: Import Deputes_OrganismeParlementaire | |
run: bun start -p | |
env: | |
SUPABASE_URL: ${{ secrets.SUPABASE_URL_STAGING }} | |
SUPABASE_KEY: ${{ secrets.SUPABASE_KEY_STAGING }} | |
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} | |
DISCORD_NOTIFICATION: ${{ secrets.DISCORD_NOTIFICATION }} | |
NOSDEPUTES_BASE_URL: ${{ secrets.NOSDEPUTES_BASE_URL_STAGING }} | |
SUPABASE_ENV: Staging | |
GITHUB_RUN_URL: ${{ env.GITHUB_RUN_URL }} | |
- 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 Staging", | |
"description": ":white_check_mark: Data imported into Staging!", | |
"color": 8311585 | |
} |