Generate Packages List from NPM #28
This file contains hidden or 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: Generate Packages List from NPM | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '0 0 * * 0' # Run at midnight UTC every Sunday | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| name: Generate Packages List from NPM | |
| steps: | |
| - name: Install Git LFS | |
| run: sudo apt-get update && sudo apt-get install git-lfs && git lfs install | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| lfs: true | |
| token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: latest | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Generate packages list | |
| env: | |
| PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
| run: node scripts/generate_actions.mjs | |
| - name: Commit generated files | |
| env: | |
| PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
| run: | | |
| git config --global user.name "Martin DONADIEU" | |
| git config --global user.email "martindonadieu@gmail.com" | |
| git lfs track "loadedVectorStore/*.json" || true | |
| git lfs track "loadedVectorStore/*.index" || true | |
| git add .gitattributes | |
| shopt -s nullglob | |
| files=(loadedVectorStore/*.json loadedVectorStore/*.index) | |
| if [ ${#files[@]} -gt 0 ]; then | |
| git add "${files[@]}" | |
| fi | |
| git add -A | |
| git commit -m "Commit generated files" | |
| git push origin main -f | |
| working-directory: ./ |