forked from kubernetes/cloud-provider-vsphere
-
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.
ci: Add release GitHub Actions workflow
- Loading branch information
1 parent
f238de8
commit 1f5b8d2
Showing
1 changed file
with
41 additions
and
0 deletions.
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,41 @@ | ||
name: Release | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
description: 'The tag to release.' | ||
type: string | ||
required: true | ||
|
||
env: | ||
GITHUB_TOKEN: "${{ secrets.MESOSPHERECI_USER_TOKEN }}" | ||
IMAGE: "ghcr.io/mesosphere/cloud-provider-vsphere" | ||
|
||
jobs: | ||
build_and_push: | ||
runs-on: | ||
- self-hosted | ||
- small | ||
steps: | ||
- name: Checks out the repository at the release tag | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
ref: ${{ inputs.tag }} | ||
- name: Go is required to build tool dependencies, as well as konvoy itself | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version-file: go.mod | ||
cache: true | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build image | ||
run: | | ||
make docker-image IMAGE="$IMAGE" BRANCH_NAME="${{ inputs.tag }}" | ||
- name: Push image | ||
run: | | ||
docker push "$IMAGE:${{ inputs.tag }}" |