Fetching Daily Contents π #453
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: Fetch Daily Content Markdown File | |
| run-name: Fetching Daily Contents π | |
| on: | |
| schedule: | |
| # Runs daily at 6:00 AM,PM UTC (adjust the cron expression as needed) | |
| - cron: '0 6 * * *' | |
| permissions: | |
| contents: write | |
| jobs: | |
| generate-file: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| - name: Get current date | |
| run: echo "DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 # Specify your Node.js version | |
| cache: npm | |
| - name: Install dependencies | |
| run: | | |
| npm ci | |
| - name: Run fetch.sh | |
| run: |- | |
| npm run devo-api-build | |
| sh fetch.sh | |
| - name: Print awesome-devblog.netlify.app | |
| run: | | |
| echo "Generated 'awesome-devblog.netlify.app' Markdown content ..." | |
| cat scripts/src/awesome-devblog-*.md | |
| - name: Print news.hada.io | |
| run: | | |
| echo "Generated 'news.hada.io' Markdown content ..." | |
| cat scripts/src/geek-*.md | |
| - name: Print jhrogue.blogspot.com | |
| run: | | |
| echo "Generated 'jhrogue.blogspot.com' Markdown content ..." | |
| cat scripts/src/jhrogue-*.md | |
| - name: Print devo | |
| run: | | |
| echo "Generated 'devo' JSON content ... " | |
| cat scripts/src/devo-*.json | |
| - name: Upload generated files as an artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: gf-${{ env.DATE }} | |
| path: | | |
| scripts/src/*.md | |
| scripts/src/*.json |