30 lines
871 B
YAML
30 lines
871 B
YAML
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
|
|
|