Skip to content

Commit

Permalink
Split into different jobs in same workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
gmolki committed Mar 22, 2024
1 parent e411454 commit 7e39576
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 80 deletions.
31 changes: 0 additions & 31 deletions .github/workflows/aleph_ipfs_pin.yaml

This file was deleted.

40 changes: 0 additions & 40 deletions .github/workflows/build.yaml

This file was deleted.

73 changes: 64 additions & 9 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,69 @@
name: Deploy

on:
workflow_run:
workflows: ["Aleph IPFS Pin"]
branches: [main]
types:
- completed
name: Build and Deploy

"on":
push:
branches:
- main
jobs:
build:
build-project:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3

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

- name: Cache Node Modules
uses: actions/cache@v3
with:
path: |
~/.npm
**/node_modules
key: "${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}"
restore-keys: |
${{ runner.os }}-node-
- name: Install Dependencies and Build Project
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
- uses: actions/upload-artifact@v3
with:
name: aleph-node-metrics-build-artifact
path: out/
id: aleph-node-metrics-build-artifact

push-to-ipfs:
needs: build-project
runs-on: ubuntu-22.04
steps:
- name: Download Build Artifact
uses: actions/download-artifact@v3
with:
name: aleph-node-metrics-build-artifact

- name: Install aioipfs
run: |
pip install 'aioipfs>=0.6.2'
- name: Push on IPFS
run: |
IPFS_CID=$(python3 ./scripts/aleph_ipfs_push.py)
echo $IPFS_CID > ipfs_cid.txt
- uses: actions/upload-artifact@v3
with:
name: ipfs-cid
path: ipfs_cid.txt

deploy:
needs: push-to-ipfs
runs-on: ubuntu-22.04
steps:
- uses: actions/download-artifact@v3
Expand Down

0 comments on commit 7e39576

Please sign in to comment.