This repository has been archived by the owner on May 13, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Ziming Zhang <[email protected]>
- Loading branch information
Showing
2 changed files
with
62 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,39 @@ | ||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
jobs: | ||
goreleaser: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v2 | ||
- | ||
name: Unshallow | ||
# required for the changelog to work correctly | ||
run: git fetch --prune --unshallow | ||
- | ||
name: Set up Go | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: 1.13 | ||
- | ||
name: prepare changelog | ||
run: | | ||
tag=${{ github.ref }} | ||
tag=${tag##*/} | ||
cat <<EOF | tee /tmp/release.txt | ||
## Docker images | ||
- \`docker pull goharbor/harbor-cluster-operator:$tag\` | ||
EOF | ||
- | ||
name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v1 | ||
with: | ||
version: v0.129.0 | ||
args: release --rm-dist --release-footer /tmp/release.txt | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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,23 @@ | ||
on: | ||
release: | ||
types: | ||
- created | ||
- published | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
# opspresso/action-docker use body of ./target/TAG_NAME as docker tag | ||
# https://github.com/opspresso/action-docker#common-env | ||
- run: mkdir ./target | ||
- run: echo -n '${{ github.ref }}' | sed 's|refs/tags/||' > ./target/TAG_NAME | ||
- name: Docker Build & Push to Docker Hub | ||
uses: opspresso/action-docker@master | ||
with: | ||
args: --docker | ||
env: | ||
USERNAME: '${{ secrets.DOCKER_USER }}' | ||
PASSWORD: '${{ secrets.DOCKER_TOKEN }}' | ||
LATEST: 'false' |