Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Migrate from cloudflare/pages-action to wrangler-action #1312

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 42 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -460,15 +460,30 @@ jobs:
with:
name: stlite-sharing
path: website
- name: Install wrangler
run: npm install -g wrangler
- name: Login to Cloudflare
uses: cloudflare/wrangler-action@v3
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
with:
command: login
- name: Create Pages Project (if not exists)
uses: cloudflare/wrangler-action@v3
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
with:
command: pages project list | grep -q "stlite-sharing" || wrangler pages project create stlite-sharing --production-branch=main
- name: Publish
uses: cloudflare/pages-action@1
uses: cloudflare/wrangler-action@v3
id: publish
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: stlite-sharing
directory: website
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
command: pages deploy --project-name=stlite-sharing website --branch=${{ github.ref_name }} --commit-dirty=true

build-sharing-editor:
if: ${{ ! failure() }} # This job should run even if the depending jobs are skipped, but not when those jobs failed: https://qiita.com/abetomo/items/d9ede7dbeeb24f723fc5#%E8%A8%AD%E5%AE%9A%E4%BE%8B4
Expand Down Expand Up @@ -524,14 +539,29 @@ jobs:
with:
name: stlite-sharing-editor
path: website
- name: Install wrangler
run: npm install -g wrangler
- name: Login to Cloudflare
uses: cloudflare/wrangler-action@v3
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
with:
command: login
- name: Create Pages Project (if not exists)
uses: cloudflare/wrangler-action@v3
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
with:
command: pages project list | grep -q "stlite-sharing-editor" || wrangler pages project create stlite-sharing-editor --production-branch=main
- name: Publish
uses: cloudflare/pages-action@1
uses: cloudflare/wrangler-action@v3
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: stlite-sharing-editor
directory: website
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
command: pages deploy --project-name=stlite-sharing-editor website --branch=${{ github.ref_name }} --commit-dirty=true

build-desktop:
if: ${{ ! failure() }} # This job should run even if the depending jobs are skipped, but not when those jobs failed: https://qiita.com/abetomo/items/d9ede7dbeeb24f723fc5#%E8%A8%AD%E5%AE%9A%E4%BE%8B4
Expand Down
Loading