Create docker-deploy.yml
This commit is contained in:
29
.github/workflows/docker-deploy.yml
vendored
Normal file
29
.github/workflows/docker-deploy.yml
vendored
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
name: Docker Build and Push
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-push:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v1
|
||||||
|
|
||||||
|
- name: Build and push Docker image
|
||||||
|
env:
|
||||||
|
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
RELEASE_VERSION: ${{ github.event.release.tag_name }}
|
||||||
|
run: |
|
||||||
|
docker build -t joshnotwright/nhlscoreboard .
|
||||||
|
docker tag joshnotwright/nhlscoreboard:latest joshnotwright/nhlscoreboard:${RELEASE_VERSION}
|
||||||
|
docker tag joshnotwright/nhlscoreboard:latest joshnotwright/nhlscoreboard:latest
|
||||||
|
docker push joshnotwright/nhlscoreboard:${RELEASE_VERSION}
|
||||||
|
docker push joshnotwright/nhlscoreboard:latest
|
||||||
|
|
||||||
Reference in New Issue
Block a user