Skip to content

Commit

Permalink
github actions使用docker编译
Browse files Browse the repository at this point in the history
  • Loading branch information
suishui committed Oct 5, 2024
1 parent 919c82c commit 9367edc
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,23 @@ defaults:

jobs:
build:
runs-on: archlinux-latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set current ref as env variable
run: |
echo "GIT_DESC=$(git log -1 --format=%cd.%h --date=format:%Y-%m-%d_%H:%M:%S)" >> $GITHUB_ENV
ls -al
- name: 下载依赖
- name: 构建docker环境
run: |
pacman -S xmlto docbook-xsl inetutils uboot-tools dtc aarch64-linux-gnu-gcc just
docker version
docker build -t archlinux_builder:latest .
- name: 编译内核
run: |
just build
docker run --rm -it -v $(pwd):/workspace archlinux_builder:latest just build
- name: Archive artifact
uses: actions/upload-artifact@v4
Expand Down
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# 使用官方的 Node.js 镜像作为基础镜像
FROM archlinux:latest

# 设置工作目录
WORKDIR /workspace

# 将当前目录下的文件复制到工作目录中
# COPY ..

# 安装应用程序的依赖
#
RUN pacman -Syu --noconfirm --noprogressbar && \
pacman -Sy --noconfirm --noprogressbar xmlto docbook-xsl inetutils uboot-tools dtc aarch64-linux-gnu-gcc just

# 暴露应用程序的端口
# EXPOSE 3000

# 定义容器启动时运行的命令
# CMD ["node", "app.js"]

0 comments on commit 9367edc

Please sign in to comment.