-
Notifications
You must be signed in to change notification settings - Fork 1
69 lines (56 loc) · 2.28 KB
/
litteralis_fougeres_import.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Litteralis Fougeres Import
on:
workflow_dispatch:
schedule:
- cron: '15 16 * * 1' # Voir https://crontab.guru/ : tous les lundis à 16h15 GMT
jobs:
import:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Setup PHP with PECL extension
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
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 "DATABASE_URL=${{ secrets.APP_FOUGERES_IMPORT_DATABASE_URL }}" >> .env.local
echo "BDTOPO_DATABASE_URL=${{ secrets.BDTOPO_DATABASE_URL }}" >> .env.local
echo "APP_FOUGERES_LITTERALIS_CREDENTIALS=${{ secrets.APP_FOUGERES_LITTERALIS_CREDENTIALS }}" >> .env.local
echo "APP_FOUGERES_ORG_ID=${{ vars.APP_FOUGERES_ORG_ID }}" >> .env.local
- name: Run import
run: make ci_litteralis_fougeres_import BIN_PHP="php" BIN_CONSOLE="php bin/console" BIN_COMPOSER="composer"
env:
APP_FOUGERES_IMPORT_APP: ${{ vars.APP_FOUGERES_IMPORT_APP }}
- name: Get log file path
id: logfile
if: ${{ !cancelled() }}
run:
echo "path=$(find log/litteralis -type f -name '*.log' | head -n 1)" >> $GITHUB_OUTPUT
- uses: actions/upload-artifact@v3
if: ${{ !cancelled() }}
with:
name: litteralis_logfile
path: ${{ steps.logfile.outputs.path }}
retention-days: 21