This repository has been archived by the owner on Feb 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 41
84 lines (71 loc) · 2.48 KB
/
module_controller_ci_build_deploy_to_aliyun.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Module Controller Build and Deploy Master to Aliyun
run-name: ${{ github.actor }} pushed module-controller code
on:
push:
branches:
- master
paths:
- 'module-controller/**'
# enable manually running the workflow
workflow_dispatch:
env:
CGO_ENABLED: 0
GOOS: linux
WORK_DIR: module-controller
TAG: ci-test-master-latest
DOCKERHUB_REGISTRY: serverless-registry.cn-shanghai.cr.aliyuncs.com
MODULE_CONTROLLER_IMAGE_PATH: opensource/test/module-controller
INTEGRATION_TESTS_IMAGE_PATH: opensource/test/module-controller-integration-tests
POD_NAMESPACE: default
defaults:
run:
working-directory: module-controller
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
environment: production
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Docker login
uses: docker/[email protected]
with:
registry: ${{ env.DOCKERHUB_REGISTRY }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
logout: false
- name: Set up Docker buildx
uses: docker/setup-buildx-action@v2
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ hashFiles('${{ env.WORK_DIR }}/*Dockerfile') }}
- name: Build and push module-controller Docker images
uses: docker/[email protected]
with:
context: ${{ env.WORK_DIR }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
file: ${{ env.WORK_DIR }}/Dockerfile
platforms: linux/amd64
push: true
tags: ${{ env.DOCKERHUB_REGISTRY }}/${{ env.MODULE_CONTROLLER_IMAGE_PATH }}:${{ env.TAG }}
- run: sleep 30
- name: Build and push module-controller-integration-tests Docker images
uses: docker/[email protected]
with:
context: ${{ env.WORK_DIR }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
file: ${{ env.WORK_DIR }}/IntegrationTestsDockerfile
platforms: linux/amd64
push: true
tags: ${{ env.DOCKERHUB_REGISTRY }}/${{ env.INTEGRATION_TESTS_IMAGE_PATH }}:${{ env.TAG }}
#- name: kubectl-simple
# uses: steebchen/[email protected]
# with:
# config: ${{ secrets.CI_KUBE_CONFIG }}
# command: apply -f ${{ env.WORK_DIR }}/config/samples/module-deployment-controller.yaml