Nx Migrate #266
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: Nx Migrate | |
on: | |
schedule: | |
# run on every Monday at 7 AM | |
- cron: 0 7 * * 1 | |
workflow_dispatch: | |
jobs: | |
nx-migrate: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Git - Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.GH_USER_TOKEN }} | |
- name: Git - Setup | |
run: | | |
git config user.name "avchugaev" | |
git config user.email "achugaev93@gmail.com" | |
- name: Node - Setup | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- name: NPM - Set cache directory | |
id: npm-cache-dir | |
run: | | |
echo "::set-output name=dir::$(npm config get cache)" | |
- name: NPM - Restore cache | |
uses: actions/cache@v3 | |
id: npm-cache | |
with: | |
path: ${{ steps.npm-cache-dir.outputs.dir }} | |
key: ${{ runner.os }}-npm-migrate-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-npm-migrate- | |
- name: NPM - Install dependencies | |
run: npm ci --no-audit | |
- name: Nx - Create migrations | |
run: npm run migrations:create | |
- name: Nx - Run migrations | |
run: npm run migrations:run | |
continue-on-error: true | |
- name: Nx - Delete migrations file | |
run: rm ./migrations.json | |
continue-on-error: true | |
- name: Github - Create Pull Request | |
uses: peter-evans/create-pull-request@v4 | |
with: | |
token: ${{ secrets.GH_USER_TOKEN }} | |
commit-message: 'chore: :arrow_up: Migrate Nx workspace to the latest version' | |
branch: migration | |
branch-suffix: random | |
title: Migrate Nx workspace | |
body: ':arrow_up: Migrate Nx workspace' | |
labels: migration | |
assignees: avchugaev |