mirror of
https://github.com/arc53/DocsGPT.git
synced 2025-11-29 00:23:17 +00:00
38 lines
1.1 KiB
YAML
38 lines
1.1 KiB
YAML
# This GitHub Actions workflow builds and pushes Docker images to Docker Hub
|
|
# only when a GitHub release is published and the tag name contains 'latest'.
|
|
# The image is tagged as both the release tag and 'latest'.
|
|
|
|
|
|
name: Build and Push Docker Images (Release: latest only)
|
|
|
|
on:
|
|
release:
|
|
types: [published]
|
|
|
|
jobs:
|
|
build-and-push:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Log in to Docker Hub
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
- name: Build and push Docker image (only for releases with 'latest' in tag)
|
|
if: github.event_name == 'release' && contains(github.event.release.tag_name, 'latest')
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
file: ./application/Dockerfile
|
|
push: true
|
|
tags: |
|
|
arc53/docsgpt:${{ github.event.release.tag_name }}
|
|
arc53/docsgpt:latest
|