Pull from IDOL Images #100
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: Pull from IDOL Images | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| # Run the script at 0AM in UTC every Tuesday, which is 7PM or 8PM on Monday in ET. | |
| - cron: '0 0 * * TUE' | |
| pull_request: | |
| paths: | |
| - backend/scripts/pull-from-idol-images.ts | |
| - .github/workflows/pull-from-idol-images.yml | |
| jobs: | |
| check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.BOT_TOKEN }} | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: .node-version | |
| - name: Use Yarn Cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/yarn | |
| key: yarn-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }} | |
| restore-keys: yarn- | |
| - name: Install | |
| run: yarn | |
| - name: Clear out new-dti-website-redesign/public/team/teamHeadshots | |
| run: rm -rf new-dti-website-redesign/public/team/teamHeadshots && mkdir new-dti-website-redesign/public/team/teamHeadshots | |
| - name: Make Temp Directory | |
| run: mkdir backend/temp | |
| - name: Pull Images From IDOL | |
| env: | |
| FIREBASE_PRIVATE_KEY: ${{ secrets.FIREBASE_PRIVATE_KEY }} | |
| FIREBASE_PRIVATE_KEY_ID: ${{ secrets.FIREBASE_PRIVATE_KEY_ID }} | |
| run: yarn workspace backend run pull-from-idol-images | |
| - name: Move Images from backend/temp to new-dti-website-redesign/public/team/teamHeadshots | |
| run: mv backend/temp/** new-dti-website-redesign/public/team/teamHeadshots | |
| - name: Delete Temp Directory | |
| run: rm -r backend/temp | |
| - name: Create PR | |
| env: | |
| BOT_TOKEN: ${{ secrets.BOT_TOKEN }} | |
| run: yarn workspace backend run create-idol-images-pr |