Skip to content

Commit 4260d60

Browse files
committed
ci: split build and deploy workflow
1 parent 494595a commit 4260d60

File tree

2 files changed

+61
-47
lines changed

2 files changed

+61
-47
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build and Deploy
1+
name: Build
22

33
# Explicitly declare permissions
44
permissions:
@@ -14,11 +14,6 @@ on:
1414
branches:
1515
- main
1616
- workflow-run
17-
workflow_run:
18-
workflows:
19-
- Build and Deploy
20-
types:
21-
- completed
2217

2318
env:
2419
BUILD_PATH: 'out'
@@ -29,7 +24,6 @@ concurrency:
2924

3025
jobs:
3126
build:
32-
if: github.event_name == 'push' || github.event_name == 'pull_request'
3327
runs-on: ubuntu-latest
3428
steps:
3529
- name: Checkout code
@@ -54,46 +48,6 @@ jobs:
5448
name: github-pages
5549
path: ${{ env.BUILD_PATH }}
5650

57-
deploy:
58-
if: ${{ github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success' }}
59-
runs-on: ubuntu-latest
60-
needs: build
61-
outputs:
62-
cid: ${{ steps.deploy.outputs.cid }}
63-
steps:
64-
- uses: actions/download-artifact@v4
65-
with:
66-
name: github-pages
67-
path: ${{ env.BUILD_PATH }}
68-
run-id: ${{ github.event.workflow_run.id }}
69-
70-
- uses: ipfs/ipfs-deploy-action@v1
71-
name: Deploy to IPFS Mirror Providers
72-
id: deploy
73-
with:
74-
path-to-deploy: ${{ env.BUILD_PATH }}
75-
cluster-url: "/dnsaddr/ipfs-websites.collab.ipfscluster.io"
76-
cluster-user: ${{ secrets.CLUSTER_USER }}
77-
cluster-password: ${{ secrets.CLUSTER_PASSWORD }}
78-
storacha-key: ${{ secrets.STORACHA_KEY }}
79-
storacha-proof: ${{ secrets.STORACHA_PROOF }}
80-
#TODO pinata-jwt-token: ${{ secrets.PINATA_JWT_TOKEN }}
81-
github-token: ${{ github.token }}
82-
83-
# TODO: right now, DNSLink is controlled by Fleek, and we use ipfs/ipfs-deploy-action for PR previews
84-
#- name: Update DNSLink
85-
# if: false # TODO github.ref == 'refs/heads/main' # only update DNSLink for main branch
86-
# uses: ipfs/dnslink-action@v0.1
87-
# with:
88-
# cid: ${{ steps.deploy.outputs.cid }}
89-
# dnslink_domain: 'specs.ipfs.tech'
90-
# cf_record_id: ${{ secrets.CF_RECORD_ID }}
91-
# cf_zone_id: ${{ secrets.CF_ZONE_ID }}
92-
# cf_auth_token: ${{ secrets.CF_AUTH_TOKEN }}
93-
# github_token: ${{ github.token }}
94-
# set_github_status: true
95-
96-
9751
gh-pages:
9852
if: github.event_name == 'push' && github.ref == 'refs/heads/main' # only deploy to gh-pages on push to the main branch
9953
runs-on: 'ubuntu-latest'

.github/workflows/deploy.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Deploy
2+
3+
# Explicitly declare permissions
4+
permissions:
5+
contents: read
6+
pull-requests: write
7+
statuses: write
8+
9+
on:
10+
workflow_run:
11+
workflows:
12+
- Build
13+
types:
14+
- completed
15+
16+
env:
17+
BUILD_PATH: 'out'
18+
19+
concurrency:
20+
group: ${{ github.workflow }}-${{ github.ref }}
21+
cancel-in-progress: true # Cancel in progress runs if a new run is started
22+
23+
jobs:
24+
deploy:
25+
if: github.event.workflow_run.conclusion == 'success'
26+
runs-on: ubuntu-latest
27+
outputs:
28+
cid: ${{ steps.deploy.outputs.cid }}
29+
steps:
30+
- uses: actions/download-artifact@v4
31+
with:
32+
name: github-pages
33+
path: ${{ env.BUILD_PATH }}
34+
run-id: ${{ github.event.workflow_run.id }}
35+
36+
- uses: ipfs/ipfs-deploy-action@v1
37+
name: Deploy to IPFS Mirror Providers
38+
id: deploy
39+
with:
40+
path-to-deploy: ${{ env.BUILD_PATH }}
41+
cluster-url: "/dnsaddr/ipfs-websites.collab.ipfscluster.io"
42+
cluster-user: ${{ secrets.CLUSTER_USER }}
43+
cluster-password: ${{ secrets.CLUSTER_PASSWORD }}
44+
storacha-key: ${{ secrets.STORACHA_KEY }}
45+
storacha-proof: ${{ secrets.STORACHA_PROOF }}
46+
#TODO pinata-jwt-token: ${{ secrets.PINATA_JWT_TOKEN }}
47+
github-token: ${{ github.token }}
48+
49+
# TODO: right now, DNSLink is controlled by Fleek, and we use ipfs/ipfs-deploy-action for PR previews
50+
#- name: Update DNSLink
51+
# if: false # TODO github.ref == 'refs/heads/main' # only update DNSLink for main branch
52+
# uses: ipfs/dnslink-action@v0.1
53+
# with:
54+
# cid: ${{ steps.deploy.outputs.cid }}
55+
# dnslink_domain: 'specs.ipfs.tech'
56+
# cf_record_id: ${{ secrets.CF_RECORD_ID }}
57+
# cf_zone_id: ${{ secrets.CF_ZONE_ID }}
58+
# cf_auth_token: ${{ secrets.CF_AUTH_TOKEN }}
59+
# github_token: ${{ github.token }}
60+
# set_github_status: true

0 commit comments

Comments
 (0)