testing 3 #6
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: Build and Deploy | |
| on: | |
| repository_dispatch: | |
| types: [update_blog] | |
| workflow_dispatch: | |
| push: | |
| branches: [master, dev] | |
| paths-ignore: | |
| - 'src/content/posts/**' | |
| - 'public/images/blog/**' | |
| jobs: | |
| sync-and-deploy: | |
| runs-on: ubuntu-latest | |
| # This runs the entire job inside a container that already has | |
| # Node, Chrome, and Mermaid CLI installed. | |
| container: | |
| image: minlag/mermaid-cli:latest | |
| options: --user root # Ensure we have permissions to write files | |
| steps: | |
| - name: Checkout Main Repo | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GH_PAT }} | |
| - name: Checkout Blogs Repo | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: WithNucleusAI/engineering-blogs | |
| token: ${{ secrets.GH_PAT }} | |
| path: temp_blogs | |
| # Note: We skip 'Install Dependencies' for system libs | |
| # because they are already in the Docker image. | |
| - name: Install Project Deps | |
| run: npm ci | |
| - name: Process Blogs | |
| run: | | |
| # Use the mmdc binary already present in the container | |
| node scripts/process-blogs.mjs | |
| env: | |
| # We tell the script to use the container's Chromium | |
| PUPPETEER_EXECUTABLE_PATH: /usr/bin/chromium-browser | |
| - name: Build Project | |
| run: npm run build | |
| - name: Deploy to Firebase | |
| uses: FirebaseExtended/action-hosting-deploy@v0 | |
| with: | |
| repoToken: '${{ secrets.GITHUB_TOKEN }}' | |
| firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_WITHNUCLEUSAI_GITHUB_IO }}' | |
| channelId: live | |
| projectId: withnucleusai-github-io |