diff --git a/.github/workflows/metabase_migrate.yml b/.github/workflows/metabase_migrate.yml index 68edc0672..0befe2a1a 100644 --- a/.github/workflows/metabase_migrate.yml +++ b/.github/workflows/metabase_migrate.yml @@ -32,9 +32,23 @@ jobs: restore-keys: | ${{ runner.os }}-composer- + - name: Install Scalingo CLI + run: curl -O https://cli-dl.scalingo.com/install && bash install + + - name: Install SSH key + # Credit: https://stackoverflow.com/a/69234389 + run: | + mkdir -p ~/.ssh + install -m 600 -D /dev/null ~/.ssh/id_rsa + echo "${{ secrets.GH_SCALINGO_SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa + + - name: Add Scalingo as a known host + run: | + ssh-keyscan -H ssh.osc-fr1.scalingo.com >> ~/.ssh/known_hosts + - name: Init environment variables run: | - echo "METABASE_DATABASE_URL=${{ secrets.METABASE_MIGRATIONS_METABASE_DATABASE_URL }}" >> .env + echo "METABASE_DATABASE_URL=${{ secrets.METABASE_MIGRATIONS_METABASE_DATABASE_URL }}" >> .env.local - name: CI run: make ci_metabase_migrate BIN_COMPOSER="composer" BIN_CONSOLE="php bin/console" diff --git a/Makefile b/Makefile index ad72a1919..b1bc0d135 100644 --- a/Makefile +++ b/Makefile @@ -289,6 +289,8 @@ ci_bdtopo_migrate: ## Run CI steps for BD TOPO Migrate workflow ci_metabase_migrate: ## Run CI steps for Metabase Migrate workflow make composer CMD="install -n --prefer-dist" + scalingo login --ssh --ssh-identity ~/.ssh/id_rsa + ./tools/scalingodbtunnel dialog-metabase --host-url --port 10001 & ./tools/wait-for-it.sh 127.0.0.1:10001 make metabase_migrate ci_metabase_export: ## Export data to Metabase