-
Notifications
You must be signed in to change notification settings - Fork 4
42 lines (36 loc) · 1.21 KB
/
tencent.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
37
38
39
40
41
42
# This workflow will build a docker container, publish it to Tencent Kubernetes Engine (TKE) registry.
#
# To configure this workflow:
#
# 1. Set up secrets in your workspace:
# - TENCENT_CLOUD_ACCOUNT_ID with Tencent Cloud account id
# - TKE_REGISTRY_PASSWORD with TKE registry password
#
# 2. Change the values for the TKE_IMAGE_URL environment variables (below).
name: Tencent Kubernetes Engine
on:
push:
branches:
- master
# Environment variables available to all jobs and steps in this workflow
env:
TKE_IMAGE_URL: hkccr.ccs.tencentyun.com/razonyang/gopkgs
jobs:
setup-build-publish:
name: Setup, Build and Publish
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
# Build
- name: Build Docker image
run: |
docker build -t ${TKE_IMAGE_URL}:${GITHUB_SHA} -t ${TKE_IMAGE_URL}:latest .
- name: Login TKE Registry
run: |
docker login -u ${{ secrets.TENCENT_CLOUD_ACCOUNT_ID }} -p ${{ secrets.TKE_REGISTRY_PASSWORD }} ${TKE_IMAGE_URL}
# Push the Docker image to TKE Registry
- name: Publish
run: |
docker push ${TKE_IMAGE_URL}:${GITHUB_SHA}
docker push ${TKE_IMAGE_URL}:latest