generated from szheng3/rust-new-project-template
-
Notifications
You must be signed in to change notification settings - Fork 0
33 lines (28 loc) · 888 Bytes
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
name: Publish
on:
push:
branches:
- main
env:
DOCKER_REGISTRY: docker.io
DOCKER_IMAGE_NAME: sz-rust-ml-cli
# DOCKER_IMAGE_TAG: ${{ env.GITHUB_SHA }}
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_REGISTR_USERNAME }}
password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
- name: Build Docker Image
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ secrets.DOCKER_REGISTR_USERNAME }}/sz-rust-ml-cli:latest,${{ secrets.DOCKER_REGISTR_USERNAME }}/sz-rust-ml-cli:${{ github.sha }}
username: ${{ secrets.DOCKER_REGISTR_USERNAME }}
password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}