tangled
alpha
login
or
join now
doll.sister.pet
/
website
1
fork
atom
The source code for my personal website and blog.
hanna.lol
blog
website
1
fork
atom
overview
issues
pulls
pipelines
ci: configure forgejo ci for deployment
doll.sister.pet
2 months ago
509aa559
2d5eb153
+53
-41
2 changed files
expand all
collapse all
unified
split
.forgejo
workflows
deploy.yml
.gitlab-ci.yml
+53
.forgejo/workflows/deploy.yml
···
1
1
+
name: deploy
2
2
+
3
3
+
on:
4
4
+
push:
5
5
+
branches:
6
6
+
- main
7
7
+
paths:
8
8
+
- src/**/*
9
9
+
- public/**/*
10
10
+
- .forgejo/workflows/deploy.yml
11
11
+
- astro.config.mjs
12
12
+
- tsconfig.json
13
13
+
- package.json
14
14
+
- bun.lock
15
15
+
16
16
+
jobs:
17
17
+
build:
18
18
+
runs-on: trixie
19
19
+
env:
20
20
+
TERM: dumb
21
21
+
NIX_INSTALLER_INIT: "none"
22
22
+
NIX_INSTALLER_NO_CONFIRM: "true"
23
23
+
NIX_INSTALLER_ENABLE_FLAKES: "true"
24
24
+
steps:
25
25
+
- name: Checkout repository
26
26
+
uses: https://code.forgejo.org/actions/checkout@v6.0.1
27
27
+
- name: Setup lix toolchain
28
28
+
run: curl -sL https://install.lix.systems/lix | sh -s -- install linux
29
29
+
- name: Install bun dependencies
30
30
+
run: nix develop -c bun install --frozen-lockfile
31
31
+
- name: Build static files for website
32
32
+
run: nix develop -c bun run build
33
33
+
- name: Upload static files
34
34
+
uses: https://code.forgejo.org/forgejo/upload-artifact@v5
35
35
+
with:
36
36
+
name: website-${{ forge.sha }}
37
37
+
retention-days: 1
38
38
+
path: dist
39
39
+
deploy:
40
40
+
needs: [build]
41
41
+
runs-on: trixie
42
42
+
env: { TERM: "dumb" }
43
43
+
container: { image: "node:current" }
44
44
+
steps:
45
45
+
- name: Download static files
46
46
+
uses: https://code.forgejo.org/forgejo/download-artifact@v7
47
47
+
with: { name: "website-${{ forge.sha }}", path: "dist" }
48
48
+
- name: Deploy website to cloudflare
49
49
+
uses: https://github.com/cloudflare/wrangler-action@v3.14.1
50
50
+
with:
51
51
+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
52
52
+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
53
53
+
command: pages deploy dist --project-name=website
-41
.gitlab-ci.yml
···
1
1
-
stages:
2
2
-
- build
3
3
-
- deploy
4
4
-
5
5
-
workflow:
6
6
-
rules:
7
7
-
- changes:
8
8
-
- src/**/*
9
9
-
- public/**/*
10
10
-
- astro.config.mjs
11
11
-
- .gitlab-ci.yml
12
12
-
- tsconfig.json
13
13
-
- package.json
14
14
-
- flake.lock
15
15
-
- flake.nix
16
16
-
- bun.lock
17
17
-
18
18
-
build:
19
19
-
stage: build
20
20
-
image: alpine:edge
21
21
-
variables:
22
22
-
TERM: "dumb"
23
23
-
NIX_INSTALLER_NO_CONFIRM: "true"
24
24
-
NIX_INSTALLER_ENABLE_FLAKES: "true"
25
25
-
before_script:
26
26
-
- apk add --no-cache curl bash git xz
27
27
-
- curl -sL https://install.lix.systems/lix | sh -s -- install linux --init none
28
28
-
- source /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
29
29
-
script:
30
30
-
- nix develop -c bun install
31
31
-
- nix develop -c bun run build
32
32
-
artifacts:
33
33
-
name: website-$CI_COMMIT_SHA
34
34
-
expire_in: 1 day
35
35
-
paths: [dist]
36
36
-
37
37
-
deploy:
38
38
-
stage: deploy
39
39
-
image: node:alpine
40
40
-
needs: [build]
41
41
-
script: npx wrangler pages deploy dist --project-name=website