linuxandy
linuxandy
CDCloudflare Developers
Created by linuxandy on 10/7/2023 in #pages-help
Deploying Cloudflare Pages site using Terraform
Solved it - for anyone else new to this - dont forget to create your github workflow for deploying 😛 This is what I ended up with as my github action workflow
name: Deploy Hugo to Cloudflare Pages

on:
push:
branches:
- main # Replace with your default branch if not 'main'

jobs:
build:
runs-on: ubuntu-latest

steps:
# Checkout the repository
- name: Checkout
uses: actions/checkout@v3

# Setup Hugo
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: "0.87.0" # Replace with your desired Hugo version

# Build the Hugo site
- name: Build
run: hugo --minify

# Deploy to Cloudflare Pages
- name: Deploy to Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}
projectName: blog # Replace with your Cloudflare project name
directory: public # Replace if your build directory is different
wranglerVersion: "3"
name: Deploy Hugo to Cloudflare Pages

on:
push:
branches:
- main # Replace with your default branch if not 'main'

jobs:
build:
runs-on: ubuntu-latest

steps:
# Checkout the repository
- name: Checkout
uses: actions/checkout@v3

# Setup Hugo
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: "0.87.0" # Replace with your desired Hugo version

# Build the Hugo site
- name: Build
run: hugo --minify

# Deploy to Cloudflare Pages
- name: Deploy to Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}
projectName: blog # Replace with your Cloudflare project name
directory: public # Replace if your build directory is different
wranglerVersion: "3"
6 replies
CDCloudflare Developers
Created by linuxandy on 10/7/2023 in #pages-help
Deploying Cloudflare Pages site using Terraform
Ah I think Ive figured it out - will update once fully understood - apologies for the noise
6 replies
CDCloudflare Developers
Created by linuxandy on 10/7/2023 in #pages-help
Deploying Cloudflare Pages site using Terraform
No description
6 replies
CDCloudflare Developers
Created by linuxandy on 10/7/2023 in #pages-help
Deploying Cloudflare Pages site using Terraform
This is what Im greeted with on my cloudflare page after a successful terraform apply
6 replies