Compare commits
No commits in common. "7d663a4981b54b2d9757fc4fa7a2fc85b60ce84b" and "63fd7322f2a4b6d1ca358f2fa1d8dc94ea98c8a2" have entirely different histories.
7d663a4981
...
63fd7322f2
@ -2,7 +2,7 @@ name: Build and deploy
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [master]
|
branches: [ master ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-wasm:
|
build-wasm:
|
||||||
@ -10,51 +10,51 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
working_directory: "./src"
|
working_directory: "./src"
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v2
|
uses: actions/setup-go@v2
|
||||||
with:
|
with:
|
||||||
go-version: 1.21
|
go-version: 1.21
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: go build -v -o main.wasm ./...
|
run: go build -v -o main.wasm ./...
|
||||||
working-directory: ${{env.working_directory}}
|
working-directory: ${{env.working_directory}}
|
||||||
env:
|
env:
|
||||||
GOOS: js
|
GOOS: js
|
||||||
GOARCH: wasm
|
GOARCH: wasm
|
||||||
|
|
||||||
- name: Upload wasm file
|
- name: Upload wasm file
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: wasm
|
name: wasm
|
||||||
path: ${{env.working_directory}}/main.wasm
|
path: ${{env.working_directory}}/main.wasm
|
||||||
|
|
||||||
build-react:
|
build-react:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
working_directory: "./client"
|
working_directory: "./client"
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Setup Node.js environment
|
- name: Setup Node.js environment
|
||||||
uses: actions/setup-node@v2.5.0
|
uses: actions/setup-node@v2.5.0
|
||||||
with:
|
with:
|
||||||
node-version-file: .nvmrc
|
node-version-file: .nvmrc
|
||||||
|
|
||||||
- name: NPM CI
|
- name: NPM CI
|
||||||
working-directory: ${{env.working_directory}}
|
working-directory: ${{env.working_directory}}
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
- name: React build
|
- name: React build
|
||||||
working-directory: ${{env.working_directory}}
|
working-directory: ${{env.working_directory}}
|
||||||
run: npm run build
|
run: npm run build
|
||||||
|
|
||||||
- name: Upload react client
|
- name: Upload react client
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: react-app
|
name: react-app
|
||||||
path: ${{env.working_directory}}/build
|
path: ${{env.working_directory}}/build
|
||||||
|
|
||||||
merge:
|
merge:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@ -80,33 +80,30 @@ jobs:
|
|||||||
name: react-app-wasm
|
name: react-app-wasm
|
||||||
path: app
|
path: app
|
||||||
|
|
||||||
pin:
|
web3-storage:
|
||||||
name: Pin to cluster node
|
name: Push to web3.storage
|
||||||
needs: build
|
needs: merge
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
|
||||||
image: catthehacker/ubuntu:act-latest
|
|
||||||
outputs:
|
outputs:
|
||||||
cid: ${{ steps.pin.outputs.cid }}
|
cid: ${{ steps.web3.outputs.cid }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/download-artifact@v3
|
- uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: react-app-wasm
|
name: react-app-wasm
|
||||||
path: app
|
path: react-app-wasm
|
||||||
|
|
||||||
- name: pin
|
- name: Push to web3.storage
|
||||||
id: pin
|
uses: web3-storage/add-to-web3@v1
|
||||||
uses: docker://gitea.bruyant.xyz/alexandre/ipfs-node-pin:main
|
id: web3
|
||||||
with:
|
with:
|
||||||
ipfs_host: "ipfs-api.ipfs.svc"
|
web3_token: ${{ secrets.WEB3_STORAGE_TOKEN }}
|
||||||
ipfs_port: "5001"
|
path_to_add: react-app-wasm
|
||||||
path_to_add: app
|
|
||||||
- name: print CID
|
- run: echo ${{ steps.web3.outputs.cid }}
|
||||||
run: echo ${{ steps.pin.outputs.cid }}
|
|
||||||
|
|
||||||
update-dns:
|
update-dns:
|
||||||
name: Update OVH DNS
|
name: Update OVH DNS
|
||||||
needs: [pin]
|
needs: [web3-storage]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: OVH alter DNS record
|
- name: OVH alter DNS record
|
||||||
@ -117,7 +114,7 @@ jobs:
|
|||||||
consumer-key: ${{ secrets.OVH_CONSUMER_KEY }}
|
consumer-key: ${{ secrets.OVH_CONSUMER_KEY }}
|
||||||
dns-zone: bruyant.xyz
|
dns-zone: bruyant.xyz
|
||||||
record-id: 5218627602
|
record-id: 5218627602
|
||||||
target: "dnslink=/ipfs/${{ needs.pin.outputs.cid }}"
|
target: "dnslink=/ipfs/${{ needs.web3-storage.outputs.cid }}"
|
||||||
|
|
||||||
- name: OVH refresh DNS zone
|
- name: OVH refresh DNS zone
|
||||||
uses: CrispyBaguette/ovh-dns-refresh-action@v1.0.1
|
uses: CrispyBaguette/ovh-dns-refresh-action@v1.0.1
|
Loading…
Reference in New Issue
Block a user