Update docker-image.yml #4
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: Docker Image CI | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: 构建镜像 | |
run: sudo docker build -t loam:latest . | |
- name: 推送到阿里云 | |
run: | | |
sudo docker login --username=${{secrets.ALI_USERNAME}} registry.cn-shanghai.aliyuncs.com --password=${{secrets.ALI_PWD}} | |
sudo docker tag loam:latest registry.cn-shanghai.aliyuncs.com/lavinci/loam:latest | |
sudo docker push registry.cn-shanghai.aliyuncs.com/lavinci/loam:latest | |
- name: 推送到docker.io | |
run: | | |
sudo docker login --username=${{secrets.DOCKER_USERNAME}} --password=${{secrets.DOCKER_PASSWORD}} | |
sudo docker tag loam:latest lavinci/loam:latest | |
sudo docker push lavinci/loam:latest |