Skip to content

Commit

Permalink
chore(ci): added qa workflow, updated dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
dzmitrykliapkou committed Jan 6, 2025
1 parent 76d4f42 commit d54cb1b
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/deploy-staging.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Build & Deploy [STAGING]

on:
push:
branches:
- main
paths:
- 'characters/**'
- 'client/**'
- 'agent/**'
- 'packages/**'
- 'package.json'
- 'turbo.json'
- 'Dockerfile'
- '.github/workflows/deploy-staging.yaml'

jobs:
build-and-push:
name: Build & Push
runs-on: ubuntu-latest
environment: qa
env:
REGISTRY_ENDPOINT: ${{ secrets.REGISTRY_ENDPOINT }}
REGISTRY_REPOSITORY: ${{ secrets.REGISTRY_REPOSITORY }}
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
outputs:
short_sha: ${{ steps.sha.outputs.short_sha }}
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set GitHub commit short SHA
id: sha
run: |
CALCULATED_SHA=$(git rev-parse --short ${{ github.sha }})
echo "short_sha=$CALCULATED_SHA" >> $GITHUB_OUTPUT
- name: Login to private registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY_ENDPOINT }}
username: ${{ env.REGISTRY_USERNAME }}
password: ${{ env.REGISTRY_PASSWORD }}
logout: true

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build Docker image(s)
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
${{ env.REGISTRY_ENDPOINT }}/${{ env.REGISTRY_REPOSITORY }}/eliza:latest
${{ env.REGISTRY_ENDPOINT }}/${{ env.REGISTRY_REPOSITORY }}/eliza:${{ steps.sha.outputs.short_sha }}
cache-from: type=gha,scope=${{ github.ref }}-eliza
cache-to: type=gha,mode=max,scope=${{ github.ref }}-eliza
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ COPY agent ./agent
COPY packages ./packages
COPY scripts ./scripts
COPY characters ./characters
COPY client ./client

# Install dependencies and build the project
RUN pnpm install \
Expand Down Expand Up @@ -50,6 +51,7 @@ COPY --from=builder /app/agent ./agent
COPY --from=builder /app/packages ./packages
COPY --from=builder /app/scripts ./scripts
COPY --from=builder /app/characters ./characters
COPY --from=builder /app/client ./client

# Set the command to run the application
CMD ["pnpm", "start"]

0 comments on commit d54cb1b

Please sign in to comment.