Skip to content

Commit

Permalink
ci: add workflow to test docker (bamboo-cms#28)
Browse files Browse the repository at this point in the history
* ci: add workflow to test docker

Signed-off-by: Frost Ming <me@frostming.com>

* fix port

Signed-off-by: Frost Ming <me@frostming.com>

* copy .env

Signed-off-by: Frost Ming <me@frostming.com>

* wrong name

Signed-off-by: Frost Ming <me@frostming.com>

* use docker

Signed-off-by: Frost Ming <me@frostming.com>

---------

Signed-off-by: Frost Ming <me@frostming.com>
  • Loading branch information
frostming authored and 180909 committed Jan 2, 2024
1 parent 05ea817 commit 27a721b
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/backend.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Backend CI
name: Backend

on:
push:
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Test Docker

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

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

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

- name: Start Docker Compose
run: |
cp .env.template .env
docker-compose up -d
# Wait for containers to start
sleep 5
- name: Check containers
run: |
docker-compose ps -a
if docker ps -a --format "{{.Status}}" | grep -q -v Up; then
echo "Some containers failed to start"
exit 1
fi
- name: Check web server
run: curl -sSfI http://localhost:8000 > /dev/null
2 changes: 1 addition & 1 deletion .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Frontend CI
name: Frontend

on:
push:
Expand Down

0 comments on commit 27a721b

Please sign in to comment.