Skip to content

Commit

Permalink
feat: website with dnslink publishing (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
vasco-santos committed Apr 26, 2022
1 parent d712482 commit 234ae36
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/website.yml
Expand Up @@ -71,6 +71,48 @@ jobs:
with:
name: ${{ matrix.browser }}-${{ matrix.os }}-test-results
path: ${{ matrix.test_results_path }}
build:
name: Build & Add to IPFS
runs-on: ubuntu-latest
outputs:
cid: ${{ steps.ipfs.outputs.cid }}
steps:
- uses: actions/checkout@v2
- uses: pnpm/action-setup@v2.0.1
with:
version: 6.32.x
- uses: actions/setup-node@v2
with:
cache: 'pnpm'
- run: pnpm install
- name: Run build
env:
# Fake environment vars required for build
NEXT_PUBLIC_ENV: dev
run: pnpm build:website
# Add the site to web3.storage, output the cid as `steps.ipfs.outputs.cid`
- name: Add to web3.storage
uses: web3-storage/add-to-web3@v2
id: ipfs
with:
path_to_add: packages/website/out
web3_token: ${{ secrets.WEB3_TOKEN }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- run: echo ${{ steps.ipfs.outputs.url }}

# Publish to the staging domain if it's a change on main 馃殌
deploy:
name: Deploy https://staging.nftstorage.link
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs: build
runs-on: ubuntu-latest
steps:
- run: npx dnslink-cloudflare --record staging --domain nftstorage.link --link /ipfs/${{ needs.build.outputs.cid }}
env:
CF_API_TOKEN: ${{ secrets.CF_GATEWAY_TOKEN }}

release:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
name: Release
Expand Down

0 comments on commit 234ae36

Please sign in to comment.