Skip to content

Commit

Permalink
ci: build and store docker image to github
Browse files Browse the repository at this point in the history
  • Loading branch information
frodrigo committed Jan 29, 2025
1 parent b1be30d commit c58b34b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 27 deletions.
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,5 @@ dist
.nuxt-storybook
storybook-static

.env
.env
.github
37 changes: 12 additions & 25 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,31 +25,18 @@ jobs:
- run: yarn lint
- run: yarn build

deploy_dev:
needs:
- build
if: github.ref == 'refs/heads/develop'
name: Deploy Dev
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎
uses: actions/checkout@v4
needs: [build]
if: github.ref == 'refs/heads/develop'

- name: Deploy
uses: appleboy/[email protected]
permissions:
contents: read
packages: write
id-token: write

steps:
- name: Docker Build and Push
uses: cartoway/docker-compose-build-push-action@main
with:
host: ${{vars.DEPLOY_SSH_HOST}}
username: ${{vars.DEPLOY_SSH_USERNAME}}
key: ${{secrets.DEPLOY_SSH_KEY_DEV}}
port: 2222
script: |
echo -n 'Deployment started at: ' &&
date -u &&
cd ${{vars.DEPLOY_SSH_PATH}} &&
git fetch &&
git pull -f origin develop &&
cd .. &&
docker compose --profile "*" build frontend &&
docker compose up -d frontend &&
echo -n 'Deployment completed at: ' &&
date -u
registry_password: ${{ secrets.GITHUB_TOKEN }}
3 changes: 2 additions & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
services:
frontend:
restart: unless-stopped
build:
context: .
dockerfile: ./Dockerfile
args:
NODE_VERSION: 20.13.1
ALPINE_VERSION: 3.19
image: ghcr.io/teritorio/clearance-frontend:develop
environment:
- NUXT_PUBLIC_API=${API}
- NUXT_PUBLIC_SENTRY_DSN=${SENTRY_DSN}
- NUXT_PUBLIC_SENTRY_ENVIRONMENT=${SENTRY_ENVIRONMENT}
ports:
- 3000:3000
restart: unless-stopped

0 comments on commit c58b34b

Please sign in to comment.