-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add a workflow to generate release
Signed-off-by: Phoeniix Zhao <[email protected]>
- Loading branch information
1 parent
2da77bb
commit 660a316
Showing
1 changed file
with
46 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,46 @@ | ||
name: release | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
|
||
env: | ||
IMAGE_ID: ghcr.io/xline-kv/xline-operator | ||
|
||
jobs: | ||
build: | ||
name: Upload Release Asset | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
with: | ||
token: ${{ secrets.GH_TOKEN }} | ||
submodules: recursive | ||
- name: Build xline operator image | ||
run: | | ||
make docker-build IMG=${{ env.IMAGE_ID }}:${{ github.ref }} | ||
- name: Login to GHCR | ||
if: startsWith(matrix.job.platform, 'linux/') | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: xline-kv | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Push docker image to GHCR | ||
run: | | ||
make docker-push IMG=${{ env.IMAGE_ID }}:${{ github.ref }} | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Release ${{ github.ref }} | ||
draft: false | ||
prerelease: false |