Skip to content

Commit 116c063

Browse files
committed
ci: build and store docker image to github
1 parent d0be3e8 commit 116c063

File tree

2 files changed

+14
-28
lines changed

2 files changed

+14
-28
lines changed

.github/workflows/test-ruby.yaml

+12-26
Original file line numberDiff line numberDiff line change
@@ -66,32 +66,18 @@ jobs:
6666
env:
6767
DATABASE_URL: postgres://postgres:postgres@localhost:5432/api
6868

69-
deploy_dev:
70-
needs:
71-
- test
72-
if: github.ref == 'refs/heads/dev' && ${{vars.DEPLOY_SSH_HOST}} != ''
73-
name: Deploy Dev
69+
docker:
7470
runs-on: ubuntu-latest
75-
steps:
76-
- name: Checkout 🛎
77-
uses: actions/checkout@v4
71+
needs: [test]
72+
if: github.ref == 'refs/heads/dev'
73+
74+
permissions:
75+
contents: read
76+
packages: write
77+
id-token: write
7878

79-
- name: Deploy
80-
uses: appleboy/[email protected]
79+
steps:
80+
- name: Docker Build and Push
81+
uses: cartoway/docker-compose-build-push-action@main
8182
with:
82-
host: ${{vars.DEPLOY_SSH_HOST}}
83-
username: ${{vars.DEPLOY_SSH_USERNAME}}
84-
key: ${{secrets.DEPLOY_SSH_KEY_DEV}}
85-
port: 2222
86-
script: |
87-
echo -n 'Deployment started at: ' &&
88-
date -u &&
89-
cd ${{vars.DEPLOY_SSH_PATH}} &&
90-
git fetch &&
91-
git checkout -f origin/dev &&
92-
git submodule init &&
93-
git submodule update &&
94-
docker compose --profile "*" build &&
95-
docker compose up -d &&
96-
echo -n 'Deployment completed at: ' &&
97-
date -u
83+
registry_password: ${{ secrets.GITHUB_TOKEN }}

docker-compose.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ services:
1818
build:
1919
context: .
2020
dockerfile: script.Dockerfile
21+
image: ghcr.io/teritorio/clearance-script:dev
2122
environment:
2223
- DATABASE_URL=postgresql://postgres@postgres:5432/postgres
2324
- PUBLIC_URL=${PUBLIC_URL}
@@ -32,6 +33,7 @@ services:
3233
api:
3334
build:
3435
context: .
36+
image: ghcr.io/teritorio/clearance-api:dev
3537
environment:
3638
- RAILS_ENV=${RAILS_ENV:-production}
3739
- SECRET_KEY_BASE=${SECRET_KEY_BASE:-Toe8eihai5ieShai}
@@ -51,8 +53,6 @@ services:
5153
restart: unless-stopped
5254

5355
frontend:
54-
build:
55-
context: frontend
5656
image: ghcr.io/teritorio/clearance-frontend:develop
5757
environment:
5858
- NUXT_PUBLIC_API=${PUBLIC_URL}/api/0.1

0 commit comments

Comments
 (0)