Skip to content

Commit

Permalink
[CI] Add workflow for building image on release (#243)
Browse files Browse the repository at this point in the history
* add workflow for building image on release

* remove manual trigger and use different variable to access release tag name
  • Loading branch information
alyssadai authored Dec 7, 2023
1 parent 87a942b commit 70d92cb
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/build_docker_on_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: build Docker image on release

on:
release:
types: [published]

jobs:
build:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/api:stable, ${{ secrets.DOCKERHUB_USERNAME }}/api:${{ github.event.release.tag_name }}

0 comments on commit 70d92cb

Please sign in to comment.