Skip to content

chore(api): make tmdb api key optional #2

chore(api): make tmdb api key optional

chore(api): make tmdb api key optional #2

name: Build and push Docker images to ghcr.io
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
run: |
echo ${{ secrets.GITHUB_TOKEN }} | docker login ${{ env.REGISTRY }} -u ${{ github.actor }} --password-stdin
- name: Build and push Docker image for API
if: github.event_name != 'pull_request'
run: |
docker build -f Dockerfile.api -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-api:latest .
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-api:latest
- name: Build and push Docker image for WWW
if: github.event_name != 'pull_request'
run: |
docker build -f Dockerfile.www -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-www:latest .
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-www:latest