Closed hyh1750522171 closed 4 months ago
使用github actions 自动化构建项目和推送容器 示例代码:
name: 构建cpu容器 on: push: paths: - 'cpu-dockerfile' # 监测指定的 Dockerfile 文件路径 # push: # branches: # # 确保这是你正在使用的分支名称 # - main permissions: contents: write jobs: publish-docker: runs-on: ubuntu-latest steps: - name: 拉源码 uses: actions/checkout@v3 with: fetch-depth: 1 - name: 登陆到DockerHub uses: docker/login-action@v2 with: username: ${{ vars.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: 构建和推送qubic-CPU镜像 uses: docker/build-push-action@v4.1.1 with: context: . file: ./cpu-dockerfile push: true tags: ${{ vars.DOCKERHUB_USERNAME }}/xxxxxxx:latest
可以考虑部署一个在线demo版本供大家体验。
使用github actions 自动化构建项目和推送容器 示例代码: