-
-
Notifications
You must be signed in to change notification settings - Fork 65
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
Showing
1 changed file
with
51 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,51 @@ | ||
# This workflow can be used to push an image off a branch to Docker Hub. | ||
# This is useful to deploy changes to AB beta or test for testing. | ||
name: Push development image | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
pr: | ||
description: 'PR number (if set, ignores above ^)' | ||
required: false | ||
type: string | ||
tag: | ||
description: 'Docker Image Tag (Version)' | ||
required: true | ||
default: 'beta' | ||
|
||
jobs: | ||
|
||
dev: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# Run only if we are deploying a branch or tag from this repo | ||
- uses: actions/checkout@v3 | ||
# empty strings evaluate to 0 | ||
if: ${{ github.event.inputs.pr == 0}} | ||
|
||
# Run only if we are deploying a PR (may be in a forked repo) | ||
- uses: actions/checkout@v3 | ||
if: ${{ github.event.inputs.pr != 0}} | ||
with: | ||
ref: ${{ format('refs/pull/{0}/head', github.event.inputs.pr) }} | ||
|
||
|
||
- name: Login to Docker Hub | ||
run: echo ${{ secrets.DOCKER_HUB_PASSWORD }} | docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin | ||
continue-on-error: true | ||
|
||
- uses: satackey/[email protected] | ||
continue-on-error: true | ||
|
||
- name: Build development image | ||
run: | | ||
docker build \ | ||
--target acousticbrainz-prod \ | ||
--tag metabrainz/acousticbrainz:"${{ github.event.inputs.tag }}" \ | ||
--build-arg GIT_COMMIT_SHA="${{ github.sha }}" . | ||
- name: Push development image | ||
run: docker push metabrainz/acousticbrainz:"${{ github.event.inputs.tag }}" |