forked from bamboo-cms/bamboo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add workflow to test docker (bamboo-cms#28)
* 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
Showing
3 changed files
with
40 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Backend CI | ||
name: Backend | ||
|
||
on: | ||
push: | ||
|
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
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 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Frontend CI | ||
name: Frontend | ||
|
||
on: | ||
push: | ||
|