update main #97
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: Update Nodes | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'nodes.json' # Trigger only when this file is modified | |
jobs: | |
remove_duplicates: | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
- name: Install Node.js and pnpm | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: "pnpm" | |
- name: Change Directory to apps/workflows | |
working-directory: apps/workflows # Set the working directory to apps/workflows | |
run: | | |
pnpm install | |
- name: Build | |
working-directory: apps/workflows # Ensure we're building in the correct directory | |
run: pnpm build | |
- name: Run TypeScript Script | |
working-directory: apps/workflows | |
env: | |
TURSO_DATABASE_URL: ${{ secrets.TURSO_DATABASE_URL }} | |
TURSO_AUTH_TOKEN: ${{ secrets.TURSO_AUTH_TOKEN }} | |
run: pnpm start | |
- name: Commit Changes to nodes.json | |
working-directory: apps/workflows | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "GitHub Actions" | |
git add nodes.json # Add the modified file to the commit | |
git diff-index --quiet HEAD || git commit -m "Update Nodes" | |
git push |