forked from kanisterio/kanister
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add github workflow to build and push kanister image (kanisterio#1991)
* Make workflow to run on-demand only * Added docs about kanister build image workflow
- Loading branch information
1 parent
700d7c2
commit d0d0a3d
Showing
2 changed files
with
61 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: build-kanister-image | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
description: 'Image tag in the format vx.x.x' | ||
required: true | ||
type: string | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: kanisterio/build | ||
|
||
jobs: | ||
# TODO: Enable following when we want to automate this workflow on push to master branch | ||
# check-files: | ||
# runs-on: ubuntu-latest | ||
# outputs: | ||
# changed: ${{ steps.changed-files.outputs.any_changed }} | ||
# steps: | ||
# - uses: actions/checkout@v3 | ||
# with: | ||
# fetch-depth: 0 | ||
# - uses: tj-actions/changed-files@v35 | ||
# name: Get changed files | ||
# id: changed-files | ||
# with: | ||
# files: docker/build/Dockerfile | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
# TODO: Uncomment following when we enable check-file job | ||
# needs: check-files | ||
# if: needs.check-files.outputs.changed == 'true' | ||
steps: | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Login to GHCR | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build and push | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: "{{defaultContext}}:docker/build" | ||
push: true | ||
tags: ${{ env.IMAGE_NAME }}:${{ inputs.tag }} |
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