Skip to content

Merge pull request #533 from stlankes/mio #496

Merge pull request #533 from stlankes/mio

Merge pull request #533 from stlankes/mio #496

Workflow file for this run

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: hermitcore
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build demo
run: cargo build -Zbuild-std=std,panic_abort --target x86_64-unknown-hermit --no-default-features -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@v5
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 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@v5
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 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@v5
with:
context: .
push: true
tags: ghcr.io/hermit-os/webserver:latest