diff --git a/.github/workflows/docker-deploy.yml b/.github/workflows/docker-deploy.yml new file mode 100644 index 0000000..e0d6405 --- /dev/null +++ b/.github/workflows/docker-deploy.yml @@ -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 +