forked from Ink-Osier/PandoraToV1Api
-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ce494a2
commit 579c02e
Showing
1 changed file
with
46 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,46 @@ | ||
name: oaifree Build and Push Docker Image | ||
|
||
on: | ||
release: | ||
types: [created] | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
description: 'Tag Name' | ||
required: true | ||
|
||
|
||
jobs: | ||
build-and-push: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
|
||
- name: Set tag name | ||
id: tag_name | ||
run: | | ||
if [ "${{ github.event_name }}" = "release" ]; then | ||
echo "::set-output name=tag::${GITHUB_REF#refs/tags/}" | ||
elif [ "${{ github.event_name }}" = "workflow_dispatch" ]; then | ||
echo "::set-output name=tag::${{ github.event.inputs.tag }}" | ||
fi | ||
- name: Build and push Docker image with Release tag | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
push: true | ||
tags: | | ||
yangclivia/pandora-to-api:${{ steps.tag_name.outputs.tag }} | ||
platforms: linux/amd64,linux/arm64 | ||
build-args: TARGETPLATFORM=${{ matrix.platform }} |