-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bump submodules
- Loading branch information
Showing
4 changed files
with
88 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Submodule duck-estimator
updated
from 46ca02 to c75f99
Submodule whattheduck-ionic
updated
from c6142e to 68a846
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters