mirror of
https://github.com/johrpan/ubigen.git
synced 2025-10-26 11:47:24 +01:00
Create docker-ci.yml
This commit is contained in:
parent
df8cd2f0c2
commit
bfde6c23f2
1 changed files with 25 additions and 0 deletions
25
.github/workflows/docker-ci.yml
vendored
Normal file
25
.github/workflows/docker-ci.yml
vendored
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
name: Docker Image CI
|
||||
on:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
pull_request:
|
||||
branches: [ "main" ]
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Get short commit hash
|
||||
run: echo "COMMIT_SHORT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
|
||||
- name: Build the Docker image
|
||||
run: docker build . --file Dockerfile --tag ubigen:$COMMIT_SHORT_HASH
|
||||
- name: Run the container
|
||||
run: docker run -dp 3464:3464 ubigen:$COMMIT_SHORT_HASH
|
||||
- name: Test the application
|
||||
run: |
|
||||
for i in {1..10}; do
|
||||
sleep 2
|
||||
echo "Try $i …"
|
||||
curl -s http://localhost:3464 | grep -q "<title>Ubigen</title>" && echo "Success" && exit 0
|
||||
done
|
||||
exit 1
|
||||
Loading…
Add table
Add a link
Reference in a new issue