-
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.
Signed-off-by: KhulnaSoft bot <[email protected]>
- Loading branch information
1 parent
8697ca7
commit aeb8601
Showing
1 changed file
with
64 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,64 @@ | ||
name: Release Tunnel | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' # Trigger on version tag push, e.g., v1.0.0 | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: '1.20' # Specify Go version if needed | ||
|
||
- name: Cache Go modules | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache/go-build | ||
key: ${{ runner.os }}-go-modules-${{ hashFiles('**/go.mod') }} | ||
restore-keys: | | ||
${{ runner.os }}-go-modules- | ||
- name: Install GoReleaser | ||
run: | | ||
curl -sL https://github.com/goreleaser/goreleaser/releases/download/v1.19.0/goreleaser_Linux_x86_64.tar.gz | tar xz | ||
sudo mv goreleaser /usr/local/bin/ | ||
- name: Run GoReleaser | ||
run: | | ||
goreleaser release --rm-dist | ||
upload-artifacts: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Upload release artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: tunnel-release | ||
path: dist/ | ||
|
||
docker-push: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Log in to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_TOKEN }} | ||
|
||
- name: Build and push Docker images | ||
run: | | ||
docker buildx create --use | ||
docker buildx build --push \ | ||
--platform linux/amd64,linux/arm64 \ | ||
-t ghcr.io/khulnasoft/tunnel:${{ github.ref }} \ | ||
-t docker.io/khulnasoft/tunnel:${{ github.ref }} . |