Skip to content

Deployment update

Deployment update #2

name: Build and Push Docs Docker Image
on:
push:
branches: [ main ]
paths:
- 'docs/**'
- '.github/workflows/docker-build-push.yml'
pull_request:
branches: [ main ]
paths:
- 'docs/**'
- '.github/workflows/docker-build-push.yml'
workflow_dispatch: # Allow manual triggering
env:
DOCKER_IMAGE_NAME: cxs-utils-docs
DOCKER_IMAGE_TAG: ${{ github.sha }}
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build and push Docker image
id: docker_build
uses: docker/build-push-action@v4
with:
context: ./docs
file: ./docs/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: quicklookup/cxs-utils:${{ env.DOCKER_IMAGE_TAG }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}