Merge pull request #202 from aitok-ai/zhaoyu/issue-118 #142
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Update https://test.aitok.us in AWS HK | |
# The workflow is triggered when a tag is pushed | |
on: | |
push: | |
branches: | |
- main | |
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 | |
echo "version=$(date +'%Y-%m-%d')-${{ github.sha }}" > client/public/assets/version.txt | |
# docker-compose build # This no longer works after docker-compose.yaml is updated | |
docker build . -t librechat:latest --target node # build the container image directly | |
# Tag it properly before push to github | |
- name: tag image and push | |
run: | | |
docker tag librechat:latest ghcr.io/${{ github.repository_owner }}/librechat:latest | |
docker push ghcr.io/${{ github.repository_owner }}/librechat:latest | |
update-ecs-service: | |
needs: build | |
uses: ./.github/workflows/update-ecs.yml | |
with: | |
environment: staging | |
name: Update ECS Service | |
secrets: inherit |