Skip to content

Commit

Permalink
ci: cloudflare
Browse files Browse the repository at this point in the history
  • Loading branch information
Ni55aN committed Mar 4, 2024
1 parent dadf638 commit fab92cd
Showing 1 changed file with 35 additions and 13 deletions.
48 changes: 35 additions & 13 deletions .github/workflows/nuxtjs.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,20 @@
# Sample workflow for building and deploying a Nuxt site to GitHub Pages
#
# To get started with Nuxt see: https://nuxtjs.org/docs/get-started/installation
#
name: Deploy

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -68,12 +58,13 @@ jobs:
env:
GTAG_ID: ${{ vars.GTAG_ID }}
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
uses: actions/upload-pages-artifact@v3
with:
name: github-pages
path: ./dist

# Deployment job
deploy:
name: Publish to GitHub Pages
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
Expand All @@ -82,4 +73,35 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
uses: actions/deploy-pages@v4

deploy-cloudflare:
name: Publish to Cloudflare Pages
environment:
name: cloudflare-pages
url: ${{ steps.deployment.outputs.url }}
permissions:
contents: read
deployments: write
runs-on: ubuntu-latest
needs: build
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: github-pages
path: .
- name: Untar
run: |
mkdir -p dist
tar -xvf artifact.tar --directory dist
- name: Publish to Cloudflare Pages
id: deployment
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ vars.CLOUDFLARE_ID }}
projectName: retejs
directory: ./dist
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
wranglerVersion: '3'

0 comments on commit fab92cd

Please sign in to comment.