-
Notifications
You must be signed in to change notification settings - Fork 747
47 lines (39 loc) · 1.34 KB
/
nightly-builds.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
name: NightlyBuild
on:
schedule:
# This is a UTC time
- cron: "0 16 * * *"
# Keep it only for test purpose, comment it once everything is ok
workflow_dispatch:
env:
# TODO: Change variable to your image's name.
IMAGE_NAME: ks-installer
IMAGE_REPO: kubespheredev
IMAGE_VERSION: latest
jobs:
push:
runs-on: ubuntu-latest
if: github.repository == 'kubesphere/ks-installer'
steps:
- uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: all
- name: Set up Docker buildx
uses: docker/setup-buildx-action@v1
- name: Log into registry
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
- name: Build image
run: |
tag=nightly-$(date '+%Y%m%d')
sed -i "2idev_tag\: $tag" roles/download/defaults/main.yml
docker buildx build --platform linux/amd64,linux/arm64 --push -f Dockerfile.complete -t $IMAGE_REPO/$IMAGE_NAME:$tag .
- name: slack
uses: 8398a7/action-slack@v3
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_NIGHTLY }}
with:
status: ${{ job.status }}
fields: repo,message,commit,author,action,eventName,ref,workflow,job,took
if: ${{ failure() }}