-
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.
* Create tag.yml Signed-off-by: Rain Wu <[email protected]>
- Loading branch information
1 parent
e270c01
commit 58d1fae
Showing
5 changed files
with
70 additions
and
6 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
.github/workflows/dockerized_ci.yml → .github/workflows/pull_request.yml
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Dockerized CI | ||
name: Pull Request | ||
|
||
on: | ||
push: | ||
|
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,61 @@ | ||
name: Release Tags | ||
|
||
on: | ||
push: | ||
tags: [ "v*" ] | ||
|
||
jobs: | ||
|
||
release-dockerhub: | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.19 | ||
|
||
- name: Unshallow | ||
run: git fetch --prune --unshallow | ||
|
||
- name: Prepare | ||
id: prepare | ||
run: | | ||
TAG=${GITHUB_REF#refs/tags/} | ||
MAJOR=${TAG%.*} | ||
SHORT_COMMIT=${GITHUB_SHA::8} | ||
DATE=$(date '+%Y-%m-%dT%H:%M:%SZ') | ||
echo ::set-output name=tag_name::${TAG} | ||
echo ::set-output name=major_tag::${MAJOR} | ||
echo ::set-output name=short_commit::${SHORT_COMMIT} | ||
echo ::set-output name=date::${DATE} | ||
echo ::set-output name=full_tag_name::${TAG} | ||
echo ::set-output name=full_major_tag::${MAJOR} | ||
echo ::set-output name=latest_tag::latest | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Login to docker.io | ||
run: docker login -u r41nwu -p ${{ secrets.DOCKERHUB_ACCESS_TOKEN }} | ||
|
||
- name: Build and publish image | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: . | ||
file: "Dockerfile" | ||
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
build-args: | | ||
VERSION=${{ steps.prepare.outputs.tag_name }} | ||
SHORT_COMMIT=${{ steps.prepare.outputs.short_commit }} | ||
DATE=${{ steps.prepare.outputs.date }} | ||
tags: | | ||
r41nwu/telescope:${{ steps.prepare.outputs.full_tag_name }} | ||
r41nwu/telescope:${{ steps.prepare.outputs.full_major_tag }} | ||
r41nwu/telescope:${{ steps.prepare.outputs.latest_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
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