Skip to content

Commit

Permalink
Update docker-build-push.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
westsurname authored May 15, 2024
1 parent e5c4399 commit 319b089
Showing 1 changed file with 31 additions and 35 deletions.
66 changes: 31 additions & 35 deletions .github/workflows/docker-build-push.yml
Original file line number Diff line number Diff line change
@@ -1,60 +1,56 @@
name: Build and Push Docker images

on:
workflow_dispatch:
push:
branches:
- main
- 'main'
tags:
- 'v*'
pull_request:
branches:
- 'main'

jobs:
build-and-push:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- dockerfile: ./Dockerfile.blackhole
image: ghcr.io/${{ github.repository_owner }}/blackhole
- dockerfile: ./Dockerfile.watchlist
image: ghcr.io/${{ github.repository_owner }}/watchlist
- dockerfile: ./Dockerfile.plex_authentication
image: ghcr.io/${{ github.repository_owner }}/plex_authentication
- dockerfile: ./Dockerfile.plex_request
image: ghcr.io/${{ github.repository_owner }}/plex_request
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ matrix.image }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3

- name: Log in to GitHub Container Registry
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# - name: Load .env file
# id: dotenv
# uses: falti/[email protected]

- name: Build and push blackhole image
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile.blackhole
push: true
tags: ghcr.io/${{ github.repository }}/blackhole:latest

- name: Build and push watchlist image
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile.watchlist
push: true
tags: ghcr.io/${{ github.repository }}/watchlist:latest

- name: Build and push plex_authentication image
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile.plex_authentication
push: true
tags: ghcr.io/${{ github.repository }}/plex_authentication:latest

- name: Build and push plex_request image
uses: docker/build-push-action@v2
- name: Build and push docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile.plex_request
file: ${{ matrix.dockerfile }}
push: true
tags: ghcr.io/${{ github.repository }}/plex_request:latest
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit 319b089

Please sign in to comment.