forked from Amsterdam/signals
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a github action to create a Docker image and push it to the doc…
…ker registry when a new release is published (will trigger on released and prereleased)
- Loading branch information
Showing
1 changed file
with
27 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,27 @@ | ||
name: Build a Docker image and push to Docker when a new release is published | ||
|
||
on: | ||
release: | ||
types: [ published ] | ||
|
||
jobs: | ||
build_and_push: | ||
name: Build an Docker image for the release and push it to Docker | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Login to Docker | ||
run: echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin | ||
|
||
- name: Release tag | ||
run: echo "${{ github.event.release.tag_name }}" | ||
|
||
- name: Build the Docker image release | ||
run: | | ||
cd api/ | ||
docker build -t signalen/backend:${{ github.event.release.tag_name }} . | ||
- name: Push the tagged image to Docker | ||
run: docker push signalen/backend:${{ github.event.release.tag_name }} |