Skip to content

Commit

Permalink
ci: add GitHub Actions job for building and testing Docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
fityannugroho committed Nov 20, 2024
1 parent f853aa1 commit 5c6c5b4
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/pr-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,28 @@ jobs:

- name: Run unit tests
run: pnpm run test

build-and-test-docker:
name: Build and test Docker image
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

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

- name: Build the Docker image
run: docker buildx build --platform linux/amd64,linux/arm64 -t idn-area:${{ github.sha }} .

- name: Run Docker compose
run: docker-compose -f /mnt/data/docker-compose.yml up -d

- name: Run e2e tests with Docker
run: |
docker-compose -f /mnt/data/docker-compose.yml exec app \
pnpm run test:e2e
- name: Tear down Docker compose
run: docker-compose -f /mnt/data/docker-compose.yml down

0 comments on commit 5c6c5b4

Please sign in to comment.