-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (30 loc) · 975 Bytes
/
docker.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
34
35
36
name: Build and Deploy to ACK
on:
push:
branches:
- master
env:
REGION_ID: cn-chengdu
REGISTRY: registry.cn-chengdu.aliyuncs.com
NAMESPACE: wizz-project
IMAGE: score-assistant-be
TAG: ${{ github.sha }}
jobs:
build:
runs-on: ubuntu-latest
environment: production
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Login to ACR with the AccessKey pair
uses: aliyun/acr-login@v1
with:
login-server: https://registry.cn-chengdu.aliyuncs.com
username: "${{ secrets.REGISTRY_USERNAME }}"
password: "${{ secrets.REGISTRY_PASSWORD }}"
- name: Build and push image to ACR
run: |
docker build --tag "$REGISTRY/$NAMESPACE/$IMAGE:$TAG" .
docker push "$REGISTRY/$NAMESPACE/$IMAGE:$TAG"
docker tag "$REGISTRY/$NAMESPACE/$IMAGE:$TAG" "$REGISTRY/$NAMESPACE/$IMAGE:latest"
docker push "$REGISTRY/$NAMESPACE/$IMAGE:latest"