CD #29
This file contains 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: CD | |
on: | |
workflow_run: | |
workflows: ["CI"] | |
branches: [main] | |
types: [completed] | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
steps: | |
# Should match ci.yml from Checkout to Build. | |
# Equivalent to `git checkout`. | |
- name: 🧰 Checkout source | |
uses: actions/checkout@v1 | |
- name: 💎 Set up Node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: "18" | |
cache: "npm" | |
- name: ⬇️ Install dependencies | |
run: npm install | |
# Runs `gatsby build`. | |
- name: 🛠️ Build | |
run: npm run build | |
# Deploy to Cloudflare Pages. Using old account info, be sure to change. | |
- name: ☁️ Deploy to Cloudflare Pages | |
uses: cloudflare/pages-action@v1 | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
accountId: fb2501e788e9af18d989d70f47d4198a | |
projectName: deckbrew-xyz | |
directory: public | |
branch: main |