-
Notifications
You must be signed in to change notification settings - Fork 88
140 lines (136 loc) · 4.63 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
name: Publish container image
on:
push:
branches:
- main
env:
GH_TOKEN: ${{ github.token }}
CARGO_TERM_COLOR: always
jobs:
publish_image:
name: Publish container image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: hermit-os
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build demo
run: cargo build -Zbuild-std=std,panic_abort --target x86_64-unknown-hermit -p rusty_demo --release
- name: Copy demo out of target dir
run: cp target/x86_64-unknown-hermit/release/rusty_demo .
- name: Download loader
run: |
gh release download --repo hermit-os/loader --pattern hermit-loader-x86_64
gh release download --repo hermit-os/loader --pattern hermit-loader-x86_64-fc
- name: Create dockerfile for rusty_demo
run: |
cat << END > Dockerfile
FROM scratch
COPY hermit-loader-x86_64 hermit/hermit-loader
COPY hermit-loader-x86_64-fc hermit/hermit-loader-fc
COPY rusty_demo hermit/rusty_demo
CMD ["/hermit/rusty_demo"]
END
- name: Build and push container
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ghcr.io/hermit-os/rusty_demo:latest
- name: Build httpd
run: cargo build -Zbuild-std=std,panic_abort --target x86_64-unknown-hermit -p httpd --features hermit/dhcpv4 --release
- name: Copy httpd out of target dir
run: cp target/x86_64-unknown-hermit/release/httpd .
- name: Create dockerfile for httpd
run: |
cat << END > Dockerfile
FROM scratch
COPY hermit-loader-x86_64 hermit/hermit-loader
COPY hermit-loader-x86_64-fc hermit/hermit-loader-fc
COPY httpd hermit/httpd
CMD ["/hermit/httpd"]
END
- name: Build and push container
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ghcr.io/hermit-os/httpd:latest
- name: Build webserver
run: cargo build -Zbuild-std=std,panic_abort --target x86_64-unknown-hermit -p webserver --features hermit/dhcpv4 --release
- name: Copy webserver out of target dir
run: cp target/x86_64-unknown-hermit/release/webserver .
- name: Create static website
run: |
mkdir -p root
cat << END > root/index.html
<!DOCTYPE html>
<html>
<head>
<title>Hermit-OS</title>
</head>
<body>
<p>Hello from Hermit-OS! 🦀</p>
</body>
</html>
END
- name: Create dockerfile for webserver
run: |
cat << END > Dockerfile
FROM scratch
COPY root root
COPY hermit-loader-x86_64 hermit/hermit-loader
COPY hermit-loader-x86_64-fc hermit/hermit-loader-fc
COPY webserver hermit/webserver
CMD ["/hermit/webserver"]
END
- name: Build and push container
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ghcr.io/hermit-os/webserver:latest
- name: Build tls-demo
run: cargo build -Zbuild-std=std,panic_abort --target x86_64-unknown-hermit -p tls --features hermit/dhcpv4 --release
- name: Copy tls-demo out of target dir
run: cp target/x86_64-unknown-hermit/release/tls .
- name: Create dockerfile for tls-demo
run: |
cat << END > Dockerfile
FROM scratch
COPY hermit-loader-x86_64 hermit/hermit-loader
COPY hermit-loader-x86_64-fc hermit/hermit-loader-fc
COPY tls hermit/tls
CMD ["/hermit/tls"]
END
- name: Build and push container
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ghcr.io/hermit-os/tls:latest
- name: Build axum
run: cargo build -Zbuild-std=std,panic_abort --target x86_64-unknown-hermit -p axum-example --features hermit/dhcpv4 --release
- name: Copy axum out of target dir
run: cp target/x86_64-unknown-hermit/release/axum-example .
- name: Create dockerfile for axum
run: |
cat << END > Dockerfile
FROM ghcr.io/hermit-os/hermit_env:latest
COPY hermit-loader-x86_64 hermit/hermit-loader
COPY hermit-loader-x86_64-fc hermit/hermit-loader-fc
COPY axum-example hermit/axum-example
CMD ["/hermit/axum-example"]
END
- name: Build and push container
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ghcr.io/hermit-os/axum-example:latest