Update README.md #26
This file contains hidden or 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
name: Docker Build and Push | |
on: | |
push: | |
branches: | |
- main | |
- dev | |
jobs: | |
build-and-push: | |
runs-on: ubuntu-latest | |
steps: | |
# 1) Check out your repository code | |
- uses: actions/checkout@v3 | |
# 2) Set up Docker Buildx | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
# 3) Log in to Docker Hub | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
# 4a) Build & Push if on 'main' branch | |
- name: Build and Push (main) | |
if: github.ref == 'refs/heads/main' | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
push: true | |
tags: | | |
admin9705/sonarr-hunter:latest | |
admin9705/sonarr-hunter:${{ github.sha }} | |
# 4b) Build & Push if on 'dev' branch | |
- name: Build and Push (dev) | |
if: github.ref == 'refs/heads/dev' | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
push: true | |
tags: | | |
admin9705/sonarr-hunter:dev | |
admin9705/sonarr-hunter:${{ github.sha }} |