forked from rails/rails
-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (40 loc) · 1.07 KB
/
build-and-test-dev-image.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: Build and test --dev image
on: [push, pull_request]
env:
APP_NAME: devrails
APP_PATH: dev/devrails
jobs:
build-and-test-dev-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
bundler-cache: true
- name: Generate --dev app
run: |
bundle exec railties/exe/rails new $APP_PATH --dev
- name: Build image
run: |
podman build -t $APP_NAME \
-v $(pwd):$(pwd) \
-f ./$APP_PATH/Dockerfile \
./$APP_PATH
- name: Run container
run: |
podman run --name $APP_NAME \
-v $(pwd):$(pwd) \
-e SECRET_KEY_BASE_DUMMY=1 \
-p 3000:3000 $APP_NAME &
- name: Test container
run: ruby -r ./.github/workflows/scripts/test-container.rb
notify:
runs-on: ubuntu-latest
if: always() && github.ref_name == 'main'
continue-on-error: true
needs: build-and-test-dev-image
steps:
- uses: zzak/action-discord@v4
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}