forked from loft-sh/vcluster
-
Notifications
You must be signed in to change notification settings - Fork 3
40 lines (33 loc) · 1.21 KB
/
op-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
name: BuildNightlyContainerImage
on:
schedule:
# This is a UTC time
- cron: "0 0 * * *"
# Keep it only for test purpose, comment it once everything is ok
workflow_dispatch:
env:
# TODO: Change variable to your image's repo.
IMAGE_REPO: ${{ vars.IMAGE_REPO }}
IMAGE_VERSION: latest
jobs:
build:
name: Build
runs-on: self-hosted
# TODO: Change variable to your repo's name.
if: github.repository == 'edgewize-io/vcluster'
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Log into registry
run: echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ vars.DOCKER_USERNAME }} --password-stdin ${{ vars.IMAGE_REPO }}
- name: Declare some variables
shell: bash
run: |
echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> "$GITHUB_ENV"
#echo "suffix=$(git rev-parse --short "$GITHUB_SHA")" >> "$GITHUB_ENV"
echo "suffix=$(date +'%Y-%m-%d')" >> "$GITHUB_ENV"
- name: Build and push docker images
run: |
REPO=$IMAGE_REPO TAG="${{ env.branch }}-${{ env.suffix }}" make container-push