File tree Expand file tree Collapse file tree 3 files changed +69
-15
lines changed
Expand file tree Collapse file tree 3 files changed +69
-15
lines changed Original file line number Diff line number Diff line change 1+ name : Docker Build
2+
3+ on :
4+ push :
5+ branches : [main]
6+ pull_request :
7+ branches : [main]
8+
9+ jobs :
10+ docker-build :
11+ runs-on : ubuntu-latest
12+ steps :
13+ - uses : actions/checkout@v4
14+ - name : Set up Docker Buildx
15+ uses : docker/setup-buildx-action@v3
16+ - name : Build app image
17+ uses : docker/build-push-action@v5
18+ with :
19+ context : .
20+ file : Dockerfile
21+ push : false
22+ tags : hackorum:test
Original file line number Diff line number Diff line change 1+ name : Prod Boot
2+
3+ on :
4+ push :
5+ branches : [main]
6+ pull_request :
7+ branches : [main]
8+
9+ jobs :
10+ prod-boot :
11+ runs-on : ubuntu-latest
12+ timeout-minutes : 25
13+ steps :
14+ - uses : actions/checkout@v4
15+
16+ - name : Prepare deploy env file
17+ run : |
18+ cp deploy/.env.example deploy/.env
19+ # Override secrets/SSL for CI boot
20+ ruby -e "require 'securerandom'; puts \"SECRET_KEY_BASE=#{SecureRandom.hex(64)}\"" >> deploy/.env
21+ echo "FORCE_SSL=false" >> deploy/.env
22+ echo "APP_HOST=localhost" >> deploy/.env
23+
24+ - name : Start database
25+ run : docker compose -f deploy/docker-compose.yml up -d db
26+
27+ - name : Prepare database (migrations)
28+ run : docker compose -f deploy/docker-compose.yml run --rm web bin/rails db:prepare
29+
30+ - name : Start web
31+ run : docker compose -f deploy/docker-compose.yml up -d web
32+
33+ - name : Verify web healthcheck
34+ run : |
35+ for i in {1..30}; do
36+ if docker compose -f deploy/docker-compose.yml exec web sh -lc "curl -fs http://localhost:3000/up"; then
37+ exit 0
38+ fi
39+ sleep 5
40+ done
41+ docker compose -f deploy/docker-compose.yml logs --tail=200 web db
42+ exit 1
43+
44+ - name : Teardown
45+ if : always()
46+ run : docker compose -f deploy/docker-compose.yml down -v
Original file line number Diff line number Diff line change 1- name : CI
1+ name : Tests
22
33on :
44 push :
4646
4747 - name : Run specs
4848 run : bundle exec rspec
49-
50- docker-build :
51- runs-on : ubuntu-latest
52- steps :
53- - uses : actions/checkout@v4
54- - name : Set up Docker Buildx
55- uses : docker/setup-buildx-action@v3
56- - name : Build app image
57- uses : docker/build-push-action@v5
58- with :
59- context : .
60- file : Dockerfile
61- push : false
62- tags : hackorum:test
You can’t perform that action at this time.
0 commit comments