Skip to content

Commit

Permalink
CI: Docker Build and Push with custom action
Browse files Browse the repository at this point in the history
  • Loading branch information
frodrigo committed Jan 29, 2025
1 parent 72abbfe commit 286b925
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.git
.github
.env
2 changes: 2 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
RACK_ENV= # production
URL_BASE= # https://a.short.com
22 changes: 22 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
on: push

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
docker:
runs-on: ubuntu-latest
# needs: []
if: github.ref == 'refs/heads/master'

permissions:
contents: read
packages: write
id-token: write

steps:
- name: Docker Build and Push
uses: cartoway/docker-compose-build-push-action@main
with:
registry_password: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.env
9 changes: 5 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ version: '3'
services:
api:
build: .
# restart: unless-stopped
image: ghcr.io/teritorio/qr-shortener:master
volumes:
- ./data:/data
- .:/srv/app
environment:
# - RACK_ENV=production
- URL_BASE=https://a.short.com
- STORAGE_PATH=/data
RACK_ENV: ${RACK_ENV}
URL_BASE: ${URL_BASE:-https://a.short.com}
STORAGE_PATH: /data
ports:
- "8635:8635"
restart: unless-stopped

0 comments on commit 286b925

Please sign in to comment.