Skip to content

Commit

Permalink
ci: add docker release action
Browse files Browse the repository at this point in the history
  • Loading branch information
xzchaoo committed Dec 27, 2023
1 parent f8cd92d commit 42ee11c
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/upload-docker-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Upload docker image

on:
push:
branches: [ "main" ]
workflow_dispatch: { }

concurrency:
group: holoinsight-agent-upload-docker-image
cancel-in-progress: true

jobs:
upload-docker-image:
runs-on: ubuntu-latest
if: (github.repository == 'traas-stack/holoinsight')
steps:
- uses: actions/checkout@v3
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'temurin'
cache: maven
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Upload HoloInsight Docker Image
shell: bash
run: |
docker buildx create --use
tag=latest ./scripts/docker/buildx.sh
32 changes: 32 additions & 0 deletions .github/workflows/upload-release-docker-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Upload release docker image

on:
release:
types: [ published ]

concurrency:
group: holoinsight-agent-upload-release-docker-image-${{ github.event.release.tag_name }}
cancel-in-progress: true

jobs:
upload-release-docker-image:
runs-on: ubuntu-latest
if: (github.repository == 'traas-stack/holoinsight') && startsWith( github.event.release.tag_bname, "v" )
steps:
- uses: actions/checkout@v3
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'temurin'
cache: maven
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Upload HoloInsight Docker Image
shell: bash
run: |
docker buildx create --use
tag=${GITHUB_REF_NAME:1} ./scripts/docker/buildx.sh

0 comments on commit 42ee11c

Please sign in to comment.