Merge pull request #6 from neonlabsorg/feature-branch #12
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: Distribute Resources + Deploy CF | |
| on: | |
| workflow_dispatch: | |
| push: | |
| #paths: | |
| # - 'app/resources/**/*.md' | |
| branches: | |
| - main | |
| jobs: | |
| distribute-resources: | |
| runs-on: ["gha-runner-scale-set"] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18' | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Run distribution script | |
| run: node scripts/distribute-resources.js | |
| - name: Commit changes | |
| run: | | |
| git config --local user.email "action@github.com" | |
| git config --local user.name "GitHub Action" | |
| git add . | |
| git diff --quiet && git diff --staged --quiet || git commit -m "Auto-distribute resources to learning journey folders" | |
| - name: Push changes | |
| run: git push | |
| - name: Build project (Next.js) | |
| run: npm run build | |
| - name: Generate Cloudflare Pages artifacts (Next on Pages) | |
| run: npx --yes @cloudflare/next-on-pages@latest | |
| - name: Publish to Cloudflare Pages | |
| uses: cloudflare/wrangler-action@v3 | |
| with: | |
| apiToken: ${{ secrets.CF_PAGES_TOKEN }} | |
| command: | | |
| pages deploy ./.vercel/output/static --project-name="developer-playbook" |