Skip to content

Commit

Permalink
Enable duck-estimator CI
Browse files Browse the repository at this point in the history
Bump submodules
  • Loading branch information
bperel committed Dec 10, 2023
1 parent fd1b215 commit 30c1f9c
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 5 deletions.
83 changes: 83 additions & 0 deletions .github/workflows/deploy-duck-estimator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: deploy-duck-estimator

on:
workflow_dispatch:
push:
paths:
- ".github/workflows/deploy-duck-estimator.yml"
- "apps/duck-estimator"
- "pnpm-lock.yaml"
branches:
- "master"
jobs:
deploy-duck-estimator:
runs-on: ubuntu-latest
environment: production
steps:
- name: Check out repository
uses: actions/checkout@master
with:
submodules: recursive

- name: Download web .env file
uses: nicklasfrahm/scp-action@main
with:
direction: download
host: ${{ secrets.PRODUCTION_SSH_HOST }}
fingerprint: ${{ secrets.PRODUCTION_SSH_FINGERPRINT }}
username: ${{ secrets.PRODUCTION_SSH_USER }}
key: ${{ secrets.PRODUCTION_SSH_KEY }}
source: /home/bperel/workspace/DucksManager2/apps/duck-estimator/.env.prod.local
target: apps/duck-estimator/.env.prod.local

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver-opts: |
image=moby/buildkit:v0.12.3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: bperel
password: ${{ secrets.DOCKER_REGISTRY_TOKEN_DM }}

- name: Build and push app
uses: docker/build-push-action@v5
with:
context: .
file: apps/duck-estimator/Dockerfile
platforms: linux/x86_64
push: true
target: web
cache-from: type=registry,ref=ghcr.io/bperel/duck-estimator:buildcache
cache-to: type=registry,ref=ghcr.io/bperel/duck-estimator:buildcache,mode=max
tags: |
ghcr.io/bperel/duck-estimator:latest
- name: Upload docker-compose.yml file
uses: nicklasfrahm/[email protected]
with:
direction: upload
host: ${{ secrets.PRODUCTION_SSH_HOST }}
fingerprint: ${{ secrets.PRODUCTION_SSH_FINGERPRINT }}
username: ${{ secrets.PRODUCTION_SSH_USER }}
key: ${{ secrets.PRODUCTION_SSH_KEY }}
source: apps/duck-estimator/docker-compose.yml
target: /home/bperel/workspace/DucksManager2/apps/duck-estimator/docker-compose.yml

- name: Recreate container
uses: appleboy/[email protected]
env:
DOCKER_REGISTRY_TOKEN: ${{ secrets.DOCKER_REGISTRY_TOKEN_DM }}
with:
host: ${{ secrets.PRODUCTION_SSH_HOST }}
username: ${{ secrets.PRODUCTION_SSH_USER }}
key: ${{ secrets.PRODUCTION_SSH_KEY }}
command_timeout: 2m
envs: DOCKER_REGISTRY_TOKEN_duck-estimator
script: |
cd workspace/DucksManager2/apps/duck-estimator
echo `grep GITHUB_TOKEN .env.prod.local | cut -d'=' -f2` | docker login ghcr.io -u bperel --password-stdin
docker compose pull && docker compose up -d --force-recreate
2 changes: 1 addition & 1 deletion apps/duck-estimator
2 changes: 1 addition & 1 deletion apps/whattheduck-ionic
6 changes: 3 additions & 3 deletions packages/api/translations/messages.en.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"Un magazine faisant partie de vos abonnements DucksManager est récemment sorti et a donc été ajouté automatiquement à votre collection : {{publicationName}} {{issuenumber}}.": "A publication that you are subscribed to has recently released an issue which has been automatically added to your DucksManager collection : {{publicationName}} {{issuenumber}}.",
"Un visiteur a indiqué avoir oublié le mot de passe associé à l'adresse e-mail {{email}}.": "A visitor reported that they forgot the password associated with the email address {{email}}.",
"Vos tranches ont été publiées sur DucksManager !": "Your edges have been published on DucksManager!",
"Votre contribution vous a rapporté {{{{extraCreatorPoints}}}} points \"Créateur\"": "Your contribution earned you {{{{extraCreatorPoints}}}} \"Creator\" points",
"Votre contribution vous a rapporté {{{{extraPhotographerPoints}}}} points \"Photographe\"": "Your contribution earned you {{{{extraPhotographerPoints}}}} \"Photographer\" points",
"Votre contribution vous a rapporté {{extraCreatorPoints}} points \"Créateur\"": "Your contribution earned you {{extraCreatorPoints}} \"Creator\" points",
"Votre contribution vous a rapporté {{extraPhotographerPoints}} points \"Photographe\"": "Your contribution earned you {{extraPhotographerPoints}} \"Photographer\" points",
"Votre phrase de présentation a été acceptée !": "Your presentation sentence has been approved!",
"Votre phrase de présentation a été refusée.": "Your presentation sentence has been refused.",
"Votre revue de bouquinerie a été approuvée !": "Your bookstore review has been approved!",
Expand All @@ -32,4 +32,4 @@
"{{publicationName}} {{issuenumber}} a été ajouté à votre collection !": "{{publicationName}} {{issuenumber}} has been added to your collection!",
"• 1 nouvelle histoire de {{authorName}}": "• 1 new story from {{authorName}}",
"• {{newStoriesNumber}} nouvelles histoires de {{authorName}}": "• {{newStoriesNumber}} new stories from {{authorName}}"
}
}

0 comments on commit 30c1f9c

Please sign in to comment.