mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 17:00:15 +01:00
Create container.yml: build and push docker image upon tagging (#536)
This commit is contained in:
parent
76e51b8ac5
commit
49e2cdf76c
1 changed files with 47 additions and 0 deletions
47
.github/workflows/container.yml
vendored
Normal file
47
.github/workflows/container.yml
vendored
Normal file
|
|
@ -0,0 +1,47 @@
|
||||||
|
name: Docker Compose Build on Tag
|
||||||
|
|
||||||
|
# The workflow is triggered when a tag is pushed
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- "*"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
# Check out the repository
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
# Set up Docker
|
||||||
|
- name: Set up Docker
|
||||||
|
uses: docker/setup-buildx-action@v1
|
||||||
|
|
||||||
|
# Log in to GitHub Container Registry
|
||||||
|
- name: Log in to GitHub Container Registry
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
# Run docker-compose build
|
||||||
|
- name: Build Docker images
|
||||||
|
run: |
|
||||||
|
cp .env.example .env
|
||||||
|
docker-compose build
|
||||||
|
|
||||||
|
# Get Tag Name
|
||||||
|
- name: Get Tag Name
|
||||||
|
id: tag_name
|
||||||
|
run: echo "TAG_NAME=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
# Tag it properly before push to github
|
||||||
|
- name: tag image and push
|
||||||
|
run: |
|
||||||
|
docker tag librechat:latest ghcr.io/${{ github.repository_owner }}/librechat:${{ env.TAG_NAME }}
|
||||||
|
docker push ghcr.io/${{ github.repository_owner }}/librechat:${{ env.TAG_NAME }}
|
||||||
|
docker tag librechat:latest ghcr.io/${{ github.repository_owner }}/librechat:latest
|
||||||
|
docker push ghcr.io/${{ github.repository_owner }}/librechat:latest
|
||||||
Loading…
Add table
Add a link
Reference in a new issue