Skip to content

Commit

Permalink
Fix CI and deploy to prod
Browse files Browse the repository at this point in the history
  • Loading branch information
Fitblip authored Dec 11, 2024
1 parent dc95e83 commit 28d8aa9
Showing 1 changed file with 65 additions and 65 deletions.
130 changes: 65 additions & 65 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ on:
branches: [ master ]

jobs:
notify_init:
runs-on: ubuntu-latest
steps:
- name: Add SHORT_SHA env property with commit short sha
run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-7`" >> $GITHUB_ENV
- name: Discord notification PR
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
uses: Ilshidur/action-discord@master
with:
args: >
<:kolibri:790471932025372693> [[{{ SHORT_SHA }}](https://github.com/{{ GITHUB_REPOSITORY }}/commit/{{ SHORT_SHA }})] [Starting Kolibri Frontend build...](https://github.com/{{ GITHUB_REPOSITORY }}/actions/runs/{{ GITHUB_RUN_ID }}?check_suite_focus=true)
```${{ github.event.head_commit.message }}```
# notify_init:
# runs-on: ubuntu-latest
# steps:
# - name: Add SHORT_SHA env property with commit short sha
# run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-7`" >> $GITHUB_ENV
# - name: Discord notification PR
# env:
# DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
# uses: Ilshidur/action-discord@master
# with:
# args: >
# <:kolibri:790471932025372693> [[{{ SHORT_SHA }}](https://github.com/{{ GITHUB_REPOSITORY }}/commit/{{ SHORT_SHA }})] [Starting Kolibri Frontend build...](https://github.com/{{ GITHUB_REPOSITORY }}/actions/runs/{{ GITHUB_RUN_ID }}?check_suite_focus=true)
# ```${{ github.event.head_commit.message }}```

build_and_deploy_frontend:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:
apiToken: ${{ secrets.CF_API_TOKEN }}
environment: 'testnet'

- uses: cloudflare/wrangler-action@1.2.0
- uses: cloudflare/wrangler-action@v3
name: "Deploy sandbox.kolibri.finance"
if: github.ref == 'refs/heads/master' # Only deploy on merge to master
env:
Expand All @@ -66,7 +66,7 @@ jobs:
apiToken: ${{ secrets.CF_API_TOKEN }}
environment: 'sandbox'

- uses: cloudflare/wrangler-action@1.2.0
- uses: cloudflare/wrangler-action@v3
name: "Deploy zeronet.kolibri.finance"
if: github.ref == 'refs/heads/master' # Only deploy on merge to master
env:
Expand All @@ -75,7 +75,7 @@ jobs:
apiToken: ${{ secrets.CF_API_TOKEN }}
environment: 'zeronet'

- uses: cloudflare/wrangler-action@1.2.0
- uses: cloudflare/wrangler-action@v3
name: "Deploy kolibri.finance"
if: github.ref == 'refs/heads/master' # Only deploy on merge to master
env:
Expand All @@ -84,52 +84,52 @@ jobs:
apiToken: ${{ secrets.CF_API_TOKEN }}
environment: 'production'

build_and_deploy_ipfs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- uses: actions/setup-node@v2
with:
node-version: '14.17.6'

- name: Retrieve the cached "node_modules" directory (if present)
uses: actions/cache@v2
id: node-cache
with:
path: node_modules
key: node-modules-${{ runner.os }}-${{ hashFiles('package-lock.json') }}

- name: Install dependencies (if the cached directory was not found)
if: steps.node-cache.outputs.cache-hit != 'true'
run: npm install

- name: "Build & Deploy Frontend"
if: github.ref == 'refs/heads/master' # Only deploy on merge to master
env:
IPFS_URL: ${{ secrets.IPFS_URL }}
IPFS_AUTH: ${{ secrets.IPFS_AUTH }}
IPFS_BUILD: 1
run: |
npm run build
npm install [email protected] # Keep this out of direct deps
node scripts/ipfs-upload.js
notify_complete:
runs-on: ubuntu-latest
needs:
- notify_init
- build_and_deploy_frontend
- build_and_deploy_ipfs
steps:
- name: Add SHORT_SHA env property with commit short sha
run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-7`" >> $GITHUB_ENV
- name: Discord notification PR
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
uses: Ilshidur/action-discord@master
with:
args: >
<:kolibri:790471932025372693> [[{{ SHORT_SHA }}](https://github.com/{{ GITHUB_REPOSITORY }}/commit/{{ SHORT_SHA }})] [Kolibri Frontend built successfully!](https://github.com/{{ GITHUB_REPOSITORY }}/actions/runs/{{ GITHUB_RUN_ID }}?check_suite_focus=true)
```${{ github.event.head_commit.message }}```
# build_and_deploy_ipfs:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# with:
# submodules: 'recursive'
# - uses: actions/setup-node@v2
# with:
# node-version: '14.17.6'

# - name: Retrieve the cached "node_modules" directory (if present)
# uses: actions/cache@v2
# id: node-cache
# with:
# path: node_modules
# key: node-modules-${{ runner.os }}-${{ hashFiles('package-lock.json') }}

# - name: Install dependencies (if the cached directory was not found)
# if: steps.node-cache.outputs.cache-hit != 'true'
# run: npm install

# - name: "Build & Deploy Frontend"
# if: github.ref == 'refs/heads/master' # Only deploy on merge to master
# env:
# IPFS_URL: ${{ secrets.IPFS_URL }}
# IPFS_AUTH: ${{ secrets.IPFS_AUTH }}
# IPFS_BUILD: 1
# run: |
# npm run build
# npm install [email protected] # Keep this out of direct deps
# node scripts/ipfs-upload.js

# notify_complete:
# runs-on: ubuntu-latest
# needs:
# - notify_init
# - build_and_deploy_frontend
# - build_and_deploy_ipfs
# steps:
# - name: Add SHORT_SHA env property with commit short sha
# run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-7`" >> $GITHUB_ENV
# - name: Discord notification PR
# env:
# DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
# uses: Ilshidur/action-discord@master
# with:
# args: >
# <:kolibri:790471932025372693> [[{{ SHORT_SHA }}](https://github.com/{{ GITHUB_REPOSITORY }}/commit/{{ SHORT_SHA }})] [Kolibri Frontend built successfully!](https://github.com/{{ GITHUB_REPOSITORY }}/actions/runs/{{ GITHUB_RUN_ID }}?check_suite_focus=true)
# ```${{ github.event.head_commit.message }}```

0 comments on commit 28d8aa9

Please sign in to comment.