Skip to content
on: [push]
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
name: Deploy to Cloudflare Pages
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install
run: npm install
# - name: Test
# run: npm test
- name: Build
run: npm run ci
- name: Publish
uses: cloudflare/pages-action@1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: 'benhalverson' # e.g. 'my-project'
# directory: YOUR_DIRECTORY_OF_STATIC_ASSETS # e.g. 'dist'
directory: dist/cloudflare
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
- name: Outputs
run: |
echo "ID: ${{ steps.publish.outputs.id }}"
echo "URL: ${{ steps.publish.outputs.url }}"
echo "Environment: ${{ steps.publish.outputs.environment }}"
echo "Alias: ${{ steps.publish.outputs.alias }}"