Skip to content

Commit

Permalink
Publish apiserver
Browse files Browse the repository at this point in the history
  • Loading branch information
Chrisbattarbee committed Mar 27, 2024
1 parent 513d4aa commit 36654c1
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/publish-apiserver.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Create a new release when a tag is pushed, create a docker image and push it to docker hub
name: Publish ApiServer
on:
push:
tags:
- 'v*'
jobs:
publish:
name: Publish
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '^1.22.1'
- name: Build
env:
CGO_ENABLED: 0
run: |
cd apiserver
go build
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_CREATION_TOKEN }}
with:
tag_name: apiserver-${{ github.ref }}
release_name: ApiServer ${{ github.ref }}
draft: false
prerelease: false
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and Push Docker Image
uses: docker/build-push-action@v4
with:
context: apiserver
file: ./apiserver/Dockerfile
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/statusphere-apiserver:${{ github.ref_name }}
${{ secrets.DOCKERHUB_USERNAME }}/statusphere-apiserver:latest

0 comments on commit 36654c1

Please sign in to comment.