|
1 | | -# Sample workflow for building and deploying a Nuxt site to GitHub Pages |
2 | | -# |
3 | | -# To get started with Nuxt see: https://nuxtjs.org/docs/get-started/installation |
4 | | -# |
5 | 1 | name: Deploy |
6 | 2 |
|
7 | 3 | on: |
8 | | - # Runs on pushes targeting the default branch |
9 | 4 | push: |
10 | 5 | branches: ["main"] |
11 | | - |
12 | | - # Allows you to run this workflow manually from the Actions tab |
13 | 6 | workflow_dispatch: |
14 | 7 |
|
15 | | -# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages |
16 | 8 | permissions: |
17 | 9 | contents: read |
18 | 10 | pages: write |
19 | 11 | id-token: write |
20 | 12 |
|
21 | | -# Allow one concurrent deployment |
22 | 13 | concurrency: |
23 | 14 | group: "pages" |
24 | 15 | cancel-in-progress: true |
25 | 16 |
|
26 | 17 | jobs: |
27 | | - # Build job |
28 | 18 | build: |
29 | 19 | runs-on: ubuntu-latest |
30 | 20 | steps: |
@@ -68,12 +58,13 @@ jobs: |
68 | 58 | env: |
69 | 59 | GTAG_ID: ${{ vars.GTAG_ID }} |
70 | 60 | - name: Upload artifact |
71 | | - uses: actions/upload-pages-artifact@v1 |
| 61 | + uses: actions/upload-pages-artifact@v3 |
72 | 62 | with: |
| 63 | + name: github-pages |
73 | 64 | path: ./dist |
74 | 65 |
|
75 | | - # Deployment job |
76 | 66 | deploy: |
| 67 | + name: Publish to GitHub Pages |
77 | 68 | environment: |
78 | 69 | name: github-pages |
79 | 70 | url: ${{ steps.deployment.outputs.page_url }} |
|
82 | 73 | steps: |
83 | 74 | - name: Deploy to GitHub Pages |
84 | 75 | id: deployment |
85 | | - uses: actions/deploy-pages@v1 |
| 76 | + uses: actions/deploy-pages@v4 |
| 77 | + |
| 78 | + deploy-cloudflare: |
| 79 | + name: Publish to Cloudflare Pages |
| 80 | + environment: |
| 81 | + name: cloudflare-pages |
| 82 | + url: ${{ steps.deployment.outputs.url }} |
| 83 | + permissions: |
| 84 | + contents: read |
| 85 | + deployments: write |
| 86 | + runs-on: ubuntu-latest |
| 87 | + needs: build |
| 88 | + steps: |
| 89 | + - name: Download artifact |
| 90 | + uses: actions/download-artifact@v4 |
| 91 | + with: |
| 92 | + name: github-pages |
| 93 | + path: . |
| 94 | + - name: Untar |
| 95 | + run: tar -xvf artifact.tar --directory dist |
| 96 | + - name: Publish to Cloudflare Pages |
| 97 | + id: deployment |
| 98 | + uses: cloudflare/pages-action@v1 |
| 99 | + with: |
| 100 | + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} |
| 101 | + accountId: ${{ vars.CLOUDFLARE_ID }} |
| 102 | + projectName: retejs |
| 103 | + directory: ./dist |
| 104 | + gitHubToken: ${{ secrets.GITHUB_TOKEN }} |
| 105 | + wranglerVersion: '3' |
0 commit comments