Skip to content

duck-estimator: Use issuecodes as much as possible #40

duck-estimator: Use issuecodes as much as possible

duck-estimator: Use issuecodes as much as possible #40

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:
- uses: oven-sh/setup-bun@v1
- name: Check out repository
uses: actions/checkout@master
- 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.local
target: apps/duck-estimator/.env
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: bperel
password: ${{ secrets.DOCKER_REGISTRY_TOKEN_DM }}
- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 9
- name: Use Node.js 18
uses: actions/setup-node@v4
with:
node-version: 18
cache: "pnpm"
- name: Install dependencies
run: pnpm -r install
- run: pnpm build:duck-estimator
- name: Build and push app
uses: docker/build-push-action@v3
with:
context: .
file: apps/duck-estimator/Dockerfile
platforms: linux/x86_64
push: true
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
- 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