Skip to content

Commit

Permalink
Add deploy to IPFS action
Browse files Browse the repository at this point in the history
Signed-off-by: Little Human <[email protected]>
  • Loading branch information
Little Human committed Sep 11, 2022
1 parent 7e8911c commit cb4779c
Show file tree
Hide file tree
Showing 3 changed files with 103 additions and 3 deletions.
92 changes: 92 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Release
on:
# manual trigger
workflow_dispatch:

jobs:
bump_version:
name: Bump Version
runs-on: ubuntu-latest
outputs:
new_tag: ${{ steps.github_tag_action.outputs.new_tag }}
changelog: ${{ steps.github_tag_action.outputs.changelog }}
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Bump version and push tag
id: github_tag_action
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
release_branches: .*

create_release:
name: Create Release
runs-on: ubuntu-latest
needs: bump_version
if: ${{ needs.bump_version.outputs.new_tag != null }}
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up node
uses: actions/setup-node@v2
with:
node-version: 16
registry-url: https://registry.npmjs.org

- name: Install dependencies
run: yarn install --immutable --immutable-cache

- name: Build the app
run: yarn run build

- name: Export SSG
run: yarn run export

- name: Pin to IPFS
id: upload
uses: anantaramdas/ipfs-pinata-deploy-action@39bbda1ce1fe24c69c6f57861b8038278d53688d
with:
pin-name: Kongkow ${{ needs.bump_version.outputs.new_tag }}
path: "./out"
pinata-api-key: ${{ secrets.PINATA_API_KEY }}
pinata-secret-api-key: ${{ secrets.PINATA_API_SECRET_KEY }}

- name: Convert CIDv0 to CIDv1
id: convert_cidv0
uses: uniswap/[email protected]
with:
cidv0: ${{ steps.upload.outputs.hash }}

- name: Update DNS with new IPFS hash testnet
env:
CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }}
RECORD_DOMAIN: "kongkowitpku.xyz"
RECORD_NAME: "_dnslink"
CLOUDFLARE_ZONE_ID: ${{ secrets.CLOUDFLARE_ZONE_ID }}
uses: textileio/cloudflare-update-dnslink@0fe7b7a1ffc865db3a4da9773f0f987447ad5848
with:
cid: ${{ steps.upload.outputs.hash }}

- name: Create GitHub Release
id: create_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ needs.bump_version.outputs.new_tag }}
release_name: Release ${{ needs.bump_version.outputs.new_tag }}
body: |
IPFS hash of the deployment:
- CIDv0: `${{ steps.upload.outputs.hash }}`
- CIDv1: `${{ steps.convert_cidv0.outputs.cidv1 }}`
This is a Release of Coming Soon Page. The latest release is always accessible via an alias to the Cloudflare IPFS gateway at [kongkowitpku.xyz](https://kongkowitpku.xyz).
You can also access Coming Soon Page from any IPFS gateway.
**You should always use an IPFS gateway that enforces origin separation**, or the alias to the latest release at [kongkowitpku.xyz](https://kongkowitpku.xyz).
IPFS gateways:
- https://${{ steps.convert_cidv0.outputs.cidv1 }}.ipfs.dweb.link/
- https://${{ steps.convert_cidv0.outputs.cidv1 }}.ipfs.cf-ipfs.com/
- [ipfs://${{ steps.upload.outputs.hash }}/](ipfs://${{ steps.upload.outputs.hash }}/)
${{ needs.bump_version.outputs.changelog }}
12 changes: 10 additions & 2 deletions .trunk/trunk.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
version: 0.1
cli:
version: 0.17.0-beta
plugins:
sources:
- id: trunk
ref: v0.0.3
uri: https://github.com/trunk-io/plugins
cli:
version: 0.17.0-beta
sha256:
darwin_arm64: d0f10cede5ce6f2e9cf93c13b7422a87994c57912c2f1ec3b2b6273d965d3726
darwin_x86_64: de8cc96736b5888925523631926c1f5a0735bb086569ccdc3e2b62c2de2f4867
linux_x86_64: ddba5eb37e6885210b43f2466f8240fbeae5327506876705ef3935627d771d70
lint:
enabled:
- [email protected]
- git-diff-check@SYSTEM
- [email protected]
- [email protected]
- [email protected]
threshold:
- linters: [ALL]
level: high
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kongkowitpku/soon",
"version": "0.1.0",
"version": "0.0.1",
"private": true,
"scripts": {
"dev": "next dev",
Expand Down

0 comments on commit cb4779c

Please sign in to comment.