-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature] Update github workflows ci
Update github workflows ci Fixes #22 #40 Signed-off-by: zhuhuijun <[email protected]>
- Loading branch information
Showing
3 changed files
with
87 additions
and
17 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
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,38 @@ | ||
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 ghostbaby/zookeeper-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.GIT_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' |