File size: 1,372 Bytes
3b6afc0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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