Skip to content

Commit

Permalink
feat: deploy actions
Browse files Browse the repository at this point in the history
  • Loading branch information
amalcaraz committed Mar 5, 2024
1 parent 387d64f commit 8d6eb69
Show file tree
Hide file tree
Showing 4 changed files with 119 additions and 2 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/build_check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Build Check

on:
pull_request:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Node
uses: actions/setup-node@v3
with:
node-version: 18
cache: npm

- name: Install and Build
env:
FONTAWESOME_NPM_AUTH_TOKEN: ${{ secrets.FONTAWESOME_NPM_AUTH_TOKEN }}
run: |
npm config set "@fortawesome:registry" https://npm.fontawesome.com/
npm config set "//npm.fontawesome.com/:_authToken" FONTAWESOME_NPM_AUTH_TOKEN
npm ci
npm run build
41 changes: 41 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Publish

on:
push:
branches:
- main
- release/**

env:
IS_GH_PAGES: gh-pages

jobs:
build-and-deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Node
uses: actions/setup-node@v3
with:
node-version: 18
cache: npm

- name: Install and Build
env:
FONTAWESOME_NPM_AUTH_TOKEN: ${{ secrets.FONTAWESOME_NPM_AUTH_TOKEN }}
run: |
npm config set "@fortawesome:registry" https://npm.fontawesome.com/
npm config set "//npm.fontawesome.com/:_authToken" FONTAWESOME_NPM_AUTH_TOKEN
npm ci
npm run build
npm run export
touch out/.nojekyll
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: out
47 changes: 47 additions & 0 deletions .github/workflows/push_on_ipfs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Push on IPFS

on:
push:
branches:
- release/**
tags:
- '*'

jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: 18

- name: Install and Build
env:
FONTAWESOME_NPM_AUTH_TOKEN: ${{ secrets.FONTAWESOME_NPM_AUTH_TOKEN }}
run: |
npm config set "@fortawesome:registry" https://npm.fontawesome.com/
npm config set "//npm.fontawesome.com/:_authToken" FONTAWESOME_NPM_AUTH_TOKEN
npm ci
npm run build
npm run export
touch out/.nojekyll
- uses: actions/upload-artifact@v3
with:
name: front-aleph-website-cms
path: out/

- uses: actions/download-artifact@v3
with:
name: front-aleph-website-cms
path: out/

- name: Push on IPFS
run: |
find .
pip install 'aioipfs>=0.6.2'
python3 ./scripts/push_on_ipfs.py
export IPFS_CID=$(python3 ./scripts/push_on_ipfs.py)
echo $IPFS_CID
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
"lint": "next lint",
"export": "next export"
},
"dependencies": {
"@aleph-front/core": "^1.15.68",
Expand All @@ -30,4 +31,4 @@
"tailwindcss": "^3.3.0",
"typescript": "^5"
}
}
}

0 comments on commit 8d6eb69

Please sign in to comment.