|
name: Docker Compose Build on Tag |
|
|
|
|
|
on: |
|
push: |
|
tags: |
|
- "*" |
|
|
|
jobs: |
|
build: |
|
runs-on: ubuntu-latest |
|
|
|
steps: |
|
|
|
- name: Checkout |
|
uses: actions/checkout@v2 |
|
|
|
|
|
- name: Set up Docker |
|
uses: docker/setup-buildx-action@v1 |
|
|
|
|
|
- name: Log in to GitHub Container Registry |
|
uses: docker/login-action@v2 |
|
with: |
|
registry: ghcr.io |
|
username: ${{ github.actor }} |
|
password: ${{ secrets.GITHUB_TOKEN }} |
|
|
|
|
|
- name: Build Docker images |
|
run: | |
|
cp .env.example .env |
|
docker-compose build |
|
|
|
|
|
- name: Get Tag Name |
|
id: tag_name |
|
run: echo "TAG_NAME=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV |
|
|
|
|
|
- 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 |
|
|