Skip to content

Commit 8978acf

Browse files
committed
add CD to deploy neuron; fix build CI
1 parent 3514354 commit 8978acf

File tree

2 files changed

+68
-7
lines changed

2 files changed

+68
-7
lines changed

.github/workflows/core.yml

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Deploy Cogent Core App to GitHub Pages
2+
3+
on:
4+
# Runs on pushes targeting the default branch
5+
push:
6+
branches:
7+
- main
8+
9+
# Allows you to run this workflow manually from the Actions tab
10+
workflow_dispatch:
11+
12+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
13+
permissions:
14+
contents: read
15+
pages: write
16+
id-token: write
17+
18+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
19+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
20+
concurrency:
21+
group: "pages"
22+
cancel-in-progress: false
23+
24+
# Default to bash
25+
defaults:
26+
run:
27+
shell: bash
28+
29+
jobs:
30+
31+
# Build job
32+
build:
33+
runs-on: ubuntu-latest
34+
steps:
35+
- uses: actions/checkout@v3
36+
37+
- name: Install Go
38+
uses: actions/setup-go@v4
39+
with:
40+
go-version: '1.22'
41+
42+
- name: Install Core
43+
run: go install cogentcore.org/core/cmd/core@4760cbf
44+
45+
- name: Build Neuron
46+
run: core build web -dir ch2/neuron -o static/ch2/neuron
47+
48+
- name: Setup Pages
49+
id: pages
50+
uses: actions/configure-pages@v3
51+
52+
- name: Upload artifact
53+
uses: actions/upload-pages-artifact@v1
54+
with:
55+
path: "static"
56+
57+
# Deployment job
58+
deploy:
59+
environment:
60+
name: github-pages
61+
url: ${{ steps.deployment.outputs.page_url }}
62+
runs-on: ubuntu-latest
63+
needs: build
64+
steps:
65+
- name: Deploy to GitHub Pages
66+
id: deployment
67+
uses: actions/deploy-pages@v2

.github/workflows/go.yml

+1-7
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,4 @@ jobs:
2525
run: go build -v ./...
2626

2727
- name: Test
28-
run: go test -v ./... -coverprofile cover.out
29-
30-
- name: Update coverage report
31-
uses: ncruces/go-coverage-report@v0
32-
with:
33-
coverage-file: cover.out
34-
if: github.event_name == 'push'
28+
run: go test -v ./...

0 commit comments

Comments
 (0)