Skip to content

change BuildTime to BuildDuration #58

change BuildTime to BuildDuration

change BuildTime to BuildDuration #58

Workflow file for this run

#
# Copyright 2022 The OpenFunction Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name: WorkFlow for Building image
on:
push:
branches:
- 'main'
tags:
- 'v*'
paths:
- '.github/workflows/**'
- 'apis/**'
- 'config/bundle.yaml'
- 'controllers/**'
- 'hack/delete.sh'
- 'hack/deploy.sh'
- 'pkg/**'
- 'Dockerfile'
- 'main.go'
- 'Makefile'
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 30
name: Build Image
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.18.x
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build and Push image
run: |
tag=$(cat VERSION)
docker build . -t openfunction/openfunction:$tag -f Dockerfile --build-arg GOPROXY="https://proxy.golang.org"
docker push openfunction/openfunction:$tag