Skip to content

Commit

Permalink
update: Add release tag
Browse files Browse the repository at this point in the history
  • Loading branch information
Artrajz committed Oct 9, 2023
1 parent e0bf06e commit 44f554a
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 10 deletions.
26 changes: 19 additions & 7 deletions .github/workflows/docker-latest-gpu.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,42 @@
name: Docker build latest gpu
name: Docker build GPU

on:
workflow_dispatch:
push:
branches:
- 'main'
release:
types: [published]

jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: actions/checkout@v2

-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

-
name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

-
name: Set tag
id: set_tag
run: |
if [[ "${{ github.event_name }}" == "release" ]]; then
echo "::set-output name=tag::${{ github.event.release.tag_name }}-gpu"
else
echo "::set-output name=tag::latest-gpu"
fi
-
name: Build and push
uses: docker/build-push-action@v4
Expand All @@ -33,6 +45,6 @@ jobs:
file: ./Dockerfile_GPU
push: true
platforms: 'linux/amd64'
tags: artrajz/vits-simple-api:latest-gpu
tags: artrajz/vits-simple-api:${{ steps.set_tag.outputs.tag }}
cache-from: type=gha
cache-to: type=gha,mode=max
cache-to: type=gha,mode=max
22 changes: 19 additions & 3 deletions .github/workflows/docker-latest.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
name: Docker build latest
name: Docker build CPU

on:
workflow_dispatch:
push:
branches:
- 'main'
release:
types: [published]

jobs:
docker:
Expand All @@ -13,18 +15,32 @@ jobs:
-
name: Checkout
uses: actions/checkout@v3

-
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 Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

-
name: Set tag
id: set_tag
run: |
if [[ "${{ github.event_name }}" == "release" ]]; then
echo "::set-output name=tag::${{ github.event.release.tag_name }}"
else
echo "::set-output name=tag::latest"
fi
-
name: Build and push
uses: docker/build-push-action@v4
Expand All @@ -33,6 +49,6 @@ jobs:
file: ./Dockerfile
push: true
platforms: 'linux/amd64,linux/arm64'
tags: artrajz/vits-simple-api:latest
tags: artrajz/vits-simple-api:${{ steps.set_tag.outputs.tag }}
cache-from: type=gha
cache-to: type=gha,mode=max
cache-to: type=gha,mode=max

0 comments on commit 44f554a

Please sign in to comment.