mirror of
https://github.com/plexguide/Huntarr.git
synced 2026-04-28 07:59:41 -05:00
48 lines
1.2 KiB
YAML
48 lines
1.2 KiB
YAML
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/hunter-4-sonarr:latest
|
|
admin9705/hunter-4-sonarr:${{ 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/hunter-4-sonarr:dev
|
|
admin9705/hunter-4-sonarr:${{ github.sha }}
|