-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
48b4f3f
commit ee182ab
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Apply main migrations on PR merge | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize] | ||
|
||
jobs: | ||
apply-main-migrations: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Check for changes in migrations folder | ||
id: check_changes | ||
run: | | ||
git fetch origin main | ||
if git diff --quiet HEAD^ HEAD migrations; then | ||
echo "CHANGES=false" >> $GITHUB_ENV | ||
else | ||
echo "CHANGES=true" >> $GITHUB_ENV | ||
fi | ||
- name: Set up Node.js | ||
if: ${{ env.CHANGES == 'true' }} | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: "20" | ||
|
||
- name: Install dependencies | ||
if: ${{ env.CHANGES == 'true' }} | ||
run: npm install --force | ||
|
||
- name: Run TypeScript script | ||
if: ${{ env.CHANGES == 'true' }} | ||
env: | ||
DATO_API_KEY_OPENEARTH_RWS_VIEWER: ${{ secrets.DATO_API_KEY_OPENEARTH_RWS_VIEWER }} | ||
DATO_API_KEY_OPENEARTH_DATA_VIEWER: ${{ secrets.DATO_API_KEY_OPENEARTH_DATA_VIEWER }} | ||
DATO_API_KEY_NL2120: ${{ secrets.DATO_API_KEY_NL2120 }} | ||
run: npm run migrations:apply-main |
File renamed without changes.