Fix: add dockerfile.base and fix sed error in install pytorch #11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: gcnv2slam-latest | |
#触发器设置 | |
on: | |
push: | |
branches: [ "cpu" ] | |
paths: | |
- 'docker/**' | |
# 项目任务,任务之间可以并行调度 | |
jobs: | |
build: | |
# 选择云端运行的环境 | |
runs-on: ubuntu-latest | |
steps: | |
#u ses代表使用一个模块,此处使用的是checkout模块,将github项目文件导入到当前环境中 | |
- uses: actions/checkout@v3 | |
# 使用with跟在后面来为前面的模块输入参数 | |
with: | |
submodules: 'true' | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
# 这里用到了github的secrets功能,避免账户和密码随仓库泄露 | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_TOKEN }} | |
# 设置当前的发行版本tag | |
- name: Release version | |
id: release_version | |
run: | | |
app_version=$(cat docker/version.py | sed -ne "s/APP_VERSION[[:space:]]*=[[:space:]]*'v\(.*\)'/\1/p") | |
echo "app_version=$app_version" | |
echo "app_version=$app_version" >> $GITHUB_ENV | |
# 开始构建镜像 | |
- name: Build and push | |
uses: docker/build-push-action@v2 | |
with: | |
context: docker | |
file: docker/dockerfile | |
build-args: | | |
GITHUB_TOKEN=${{ secrets.RELEASE_TOKEN }} | |
platforms: | | |
linux/amd64 | |
linux/arm64 | |
push: true | |
# 指定用户/仓库名 | |
tags: | | |
${{ secrets.DOCKER_USERNAME }}/gcnv2slam:latest | |
${{ secrets.DOCKER_USERNAME }}/gcnv2slam:${{ env.app_version }} |