Skip to content

Commit 60e6ba9

Browse files
authored
Merge pull request #14 from brainbot-com/ezdac/ipfs-action
Add IPFS deployment GitHub action
2 parents 6455de0 + 430eed0 commit 60e6ba9

File tree

2 files changed

+86
-0
lines changed

2 files changed

+86
-0
lines changed

.github/actions/setup/action.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Setup
2+
description: "Setup actions"
3+
runs:
4+
using: composite
5+
steps:
6+
- uses: actions/checkout@v3
7+
8+
- name: Setup Node
9+
uses: actions/setup-node@v3
10+
with:
11+
node-version: "lts/*"
12+
cache: "npm"

.github/workflows/deploy-ipfs.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Release
2+
on:
3+
schedule:
4+
- cron: '0 10 * * 1-4' # run 12:00 UTC+2 Monday-Thursday
5+
workflow_dispatch:
6+
inputs:
7+
debug_enabled:
8+
type: boolean
9+
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
10+
required: false
11+
default: false
12+
13+
jobs:
14+
tag:
15+
runs-on: ubuntu-latest
16+
outputs:
17+
new_tag: ${{ steps.github-tag-action.outputs.new_tag }}
18+
changelog: ${{ steps.github-tag-action.outputs.changelog }}
19+
steps:
20+
- uses: actions/checkout@v3
21+
- name: Bump and tag
22+
id: github-tag-action
23+
uses: mathieudutour/[email protected]
24+
with:
25+
github_token: ${{ secrets.GITHUB_TOKEN }}
26+
# new_tag is only set when there are new semver commits
27+
# on the release branch
28+
release_branches: release
29+
default_bump: patch
30+
31+
release:
32+
needs: tag
33+
# only release when there is a new tag
34+
if: ${{ needs.tag.outputs.new_tag != null }}
35+
runs-on: ubuntu-latest
36+
steps:
37+
- uses: actions/checkout@v3
38+
- uses: ./.github/actions/setup
39+
- name: Add .env files
40+
run: echo ${{secrets.ENV_WEBSITE_BASE64}} | base64 -d > ./packages/website/.env
41+
42+
- name: Setup tmate session
43+
uses: mxschmitt/action-tmate@v3
44+
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
45+
timeout-minutes: 15
46+
with:
47+
limit-access-to-actor: true
48+
49+
- name: Build
50+
env:
51+
CI: true
52+
run: |
53+
yarn
54+
yarn workspace @package/dump-pow-contracts compile
55+
yarn workspace @package/dump-pow-website run build
56+
yarn workspace @package/dump-pow-website run export
57+
58+
- uses: aquiladev/[email protected]
59+
id: upload
60+
with:
61+
service: pinata
62+
pinataKey: ${{ secrets.PINATA_KEY }}
63+
pinataSecret: ${{ secrets.PINATA_SECRET }}
64+
65+
- name: Release
66+
uses: actions/[email protected]
67+
env:
68+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69+
with:
70+
tag_name: ${{ needs.tag.outputs.new_tag }}
71+
release_name: Release ${{ needs.tag.outputs.new_tag }}
72+
body: |
73+
74+
${{ needs.tag.outputs.changelog }}

0 commit comments

Comments
 (0)