Skip to content

Commit 15dac2b

Browse files
committed
ci: add initial website ci
1 parent 009bd28 commit 15dac2b

File tree

3 files changed

+94
-38
lines changed

3 files changed

+94
-38
lines changed

.github/workflows/publish-microzig.yml

Lines changed: 6 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
artifact-output-paths: boxzer-out
2222
ref: ${{ github.ref_name }}
2323
secrets:
24-
downloads-url: ${{ secrets.DOWNLOADS_URL }}
24+
downloads-url: ${{ secrets.BOXZER_DOWNLOADS_URL }}
2525
# Publish microzig
2626
publish-microzig:
2727
uses: ./.github/workflows/publish-base.yml
@@ -35,40 +35,8 @@ jobs:
3535
github-artifact-name: microzig-build
3636
source-path: /
3737
secrets:
38-
target-path: ${{ secrets.DEPLOY_ROOT_DATA_PATH }}
39-
ssh-key: ${{ secrets.DEPLOY_PRIVATE_KEY }}
40-
host: ${{ secrets.DEPLOY_HOST }}
41-
port: ${{ secrets.DEPLOY_PORT }}
42-
user: ${{ secrets.DEPLOY_USER }}
43-
# publish-microzig-regz:
44-
# concurrency:
45-
# group: publish
46-
# cancel-in-progress: false
47-
# uses: ./.github/workflows/publish-base.yml
48-
# with:
49-
# tag: ${{ github.ref_name }}
50-
# artifact: regz
51-
# github-artifact-name: microzig-build
52-
# artifact-target-name: "tools/regz"
53-
# source: zig-out/
54-
# secrets:
55-
# ssh-key: ${{ secrets.DEPLOY_PRIVATE_KEY }}
56-
# host: ${{ secrets.DEPLOY_HOST }}
57-
# port: ${{ secrets.DEPLOY_PORT }}
58-
# user: ${{ secrets.DEPLOY_USER }}
59-
# publish-microzig-uf2:
60-
# concurrency:
61-
# group: publish
62-
# cancel-in-progress: false
63-
# uses: ./.github/workflows/publish-base.yml
64-
# with:
65-
# tag: ${{ github.ref_name }}
66-
# artifact: regz
67-
# github-artifact-name: microzig-build
68-
# artifact-target-name: "tools/uf2"
69-
# source: zig-out/
70-
# secrets:
71-
# ssh-key: ${{ secrets.DEPLOY_PRIVATE_KEY }}
72-
# host: ${{ secrets.DEPLOY_HOST }}
73-
# port: ${{ secrets.DEPLOY_PORT }}
74-
# user: ${{ secrets.DEPLOY_USER }}
38+
target-path: ${{ secrets.DEPLOY_MZ_ROOT_DATA_PATH }}
39+
ssh-key: ${{ secrets.DEPLOY_MZ_PRIVATE_KEY }}
40+
host: ${{ secrets.DEPLOY_MZ_HOST }}
41+
port: ${{ secrets.DEPLOY_MZ_PORT }}
42+
user: ${{ secrets.DEPLOY_MZ_USER }}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Deploy Website - Staging
2+
3+
permissions:
4+
contents: write
5+
6+
on:
7+
pull_request:
8+
branches:
9+
- main
10+
paths:
11+
- .github/**
12+
- website/**
13+
14+
jobs:
15+
# Build the project to ensure it works. Also to get the binaries.
16+
build-microzig:
17+
uses: ./.github/workflows/build-base.yml
18+
with:
19+
zig-version: 0.13.0
20+
get-submodules: true
21+
github-artifact-name: website-build
22+
artifact-output-paths: zig-out
23+
# Publish microzig
24+
publish-microzig:
25+
uses: ./.github/workflows/publish-base.yml
26+
needs: build-microzig
27+
concurrency:
28+
group: publish
29+
cancel-in-progress: false
30+
with:
31+
artifact-name: website
32+
github-artifact-name: website-build
33+
source-path: /
34+
secrets:
35+
target-path: "${{ secrets.DEPLOY_WS_ROOT_DATA_PATH }}/staging/pulls/${{ github.event.number }}/"
36+
ssh-key: ${{ secrets.DEPLOY_WS_PRIVATE_KEY }}
37+
host: ${{ secrets.DEPLOY_WS_HOST }}
38+
port: ${{ secrets.DEPLOY_WS_PORT }}
39+
user: ${{ secrets.DEPLOY_WS_USER }}
40+
pr-comment:
41+
runs-on: ubuntu-latest
42+
permissions:
43+
pull-requests: write
44+
steps:
45+
- uses: mshick/add-pr-comment@v2
46+
with:
47+
message: |
48+
Heya!
49+
You can check out a preview of your PR at [${{ vars.WEBSITE_STAGING_HOST }}/pulls/${{ github.event.number }}/](${{ vars.WEBSITE_STAGING_HOST }}/pulls/${{ github.event.number }}/)!

.github/workflows/publish-website.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Deploy Website
2+
3+
permissions:
4+
contents: write
5+
6+
on:
7+
push:
8+
branches:
9+
- main
10+
paths:
11+
- .github/**
12+
- website/**
13+
14+
jobs:
15+
# Build the project to ensure it works. Also to get the binaries.
16+
build-microzig:
17+
uses: ./.github/workflows/build-base.yml
18+
with:
19+
zig-version: 0.13.0
20+
get-submodules: true
21+
github-artifact-name: website-build
22+
artifact-output-paths: zig-out
23+
# Publish microzig
24+
publish-microzig:
25+
uses: ./.github/workflows/publish-base.yml
26+
needs: build-microzig
27+
concurrency:
28+
group: publish
29+
cancel-in-progress: false
30+
with:
31+
artifact-name: website
32+
github-artifact-name: website-build
33+
source-path: /
34+
secrets:
35+
target-path: ${{ secrets.DEPLOY_WS_ROOT_DATA_PATH }}
36+
ssh-key: ${{ secrets.DEPLOY_WS_PRIVATE_KEY }}
37+
host: ${{ secrets.DEPLOY_WS_HOST }}
38+
port: ${{ secrets.DEPLOY_WS_PORT }}
39+
user: ${{ secrets.DEPLOY_WS_USER }}

0 commit comments

Comments
 (0)