This repository has been archived by the owner on Feb 18, 2024. It is now read-only.
lylingzhen pushed module-controller code #2
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: 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/login-action@v2.2.0 | |
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/build-push-action@v4.1.1 | |
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/build-push-action@v4.1.1 | |
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/kubectl@v2.1.1 | |
# with: | |
# config: ${{ secrets.CI_KUBE_CONFIG }} | |
# command: apply -f ${{ env.WORK_DIR }}/config/samples/module-deployment-controller.yaml |