From 30c1f9c1f19415dea18487aa288660fca8ed23a1 Mon Sep 17 00:00:00 2001 From: Bruno Perel Date: Sun, 10 Dec 2023 17:22:58 +0100 Subject: [PATCH] Enable duck-estimator CI Bump submodules --- .github/workflows/deploy-duck-estimator.yml | 83 +++++++++++++++++++++ apps/duck-estimator | 2 +- apps/whattheduck-ionic | 2 +- packages/api/translations/messages.en.json | 6 +- 4 files changed, 88 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/deploy-duck-estimator.yml diff --git a/.github/workflows/deploy-duck-estimator.yml b/.github/workflows/deploy-duck-estimator.yml new file mode 100644 index 000000000..48ff82c5b --- /dev/null +++ b/.github/workflows/deploy-duck-estimator.yml @@ -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/scp-action@v1.0.1 + 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/ssh-action@v1.0.0 + 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 diff --git a/apps/duck-estimator b/apps/duck-estimator index 46ca02b77..c75f993da 160000 --- a/apps/duck-estimator +++ b/apps/duck-estimator @@ -1 +1 @@ -Subproject commit 46ca02b7760391de17fad9ec9b863357311491d0 +Subproject commit c75f993daf0db9b23b77212a06ff48c307bb00f2 diff --git a/apps/whattheduck-ionic b/apps/whattheduck-ionic index c6142e4d9..68a8464f0 160000 --- a/apps/whattheduck-ionic +++ b/apps/whattheduck-ionic @@ -1 +1 @@ -Subproject commit c6142e4d9061be02e24154a27dd96514841c4414 +Subproject commit 68a8464f0eb64b0f1a80961cab981dea7991d993 diff --git a/packages/api/translations/messages.en.json b/packages/api/translations/messages.en.json index 8d0db5406..d8836f0f8 100644 --- a/packages/api/translations/messages.en.json +++ b/packages/api/translations/messages.en.json @@ -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!", @@ -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}}" -} +} \ No newline at end of file