Skip to content

Generate Image Daily #715

Generate Image Daily

Generate Image Daily #715

Workflow file for this run

name: Generate Image Daily
on:
push:
branches: [ main ]
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '30 22 * * *'
jobs:
daily-image:
runs-on: ubuntu-latest
env:
GO_VERSION: '1.16'
GOLANGCI_VERSION: 'v1.39'
DOCKER_BUILDX_VERSION: 'v0.4.2'
KUSTOMIZE_VERSION: 'v4.1.3'
KUBEDL_CI: 'true'
KIND_VERSION: 'v0.11.1'
GOPATH: ${{ github.workspace }}/go
defaults:
run:
working-directory: ${{ env.GOPATH }}/src/github.com/alibaba/morphling
steps:
- name: Check out code
uses: actions/checkout@v2
with:
path: ${{ env.GOPATH }}/src/github.com/alibaba/morphling
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- name: Check Go modules
run: |
if [[ ! -z $(go mod tidy && git diff --exit-code) ]]; then
echo "Please run "go mod tidy" to sync Go modules"
exit 1
fi
- name: Install Kubebuilder
uses: RyanSiu1995/kubebuilder-action@v1.2.1
- name: Cache Go Dependencies
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build image
run: |
make docker-build
make docker-push