Skip to content

Commit

Permalink
add flyio hosting
Browse files Browse the repository at this point in the history
  • Loading branch information
vorant94 committed Apr 21, 2024
1 parent cda0daf commit db861b0
Show file tree
Hide file tree
Showing 7 changed files with 372 additions and 32 deletions.
31 changes: 6 additions & 25 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ name: CI/CD

on: push

permissions:
contents: read
packages: write

jobs:
format-build-test-and-e2e:
timeout-minutes: 60
Expand Down Expand Up @@ -38,29 +34,14 @@ jobs:
path: ./packages/blog/playwright-report/
retention-days: 30

build-and-push:
deploy:
runs-on: ubuntu-latest
needs: format-build-test-and-e2e
if: github.ref == 'refs/heads/master'
concurrency: deploy-group
steps:
- uses: actions/checkout@v4

- uses: docker/setup-qemu-action@v3

- uses: docker/setup-buildx-action@v3

- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- id: extract-version
run: echo "VERSION=$(jq -r .version < package.json)" >> $GITHUB_OUTPUT
- uses: superfly/flyctl-actions/setup-flyctl@master

- uses: docker/build-push-action@v5
with:
context: .
file: ./packages/blog/Dockerfile
push: true
tags: ghcr.io/vorant94/digital-garden-blog:${{ steps.extract-version.outputs.VERSION }}
- run: flyctl deploy --remote-only
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20.12.2
7 changes: 2 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,12 @@ services:
- '80:80'
volumes:
- './.docker/proxy/templates:/etc/nginx/templates'
- './.docker/proxy/certs:/etc/ssl/certs'
- './.docker/proxy/private:/etc/ssl/private'
depends_on:
- blog

blog:
image: ghcr.io/vorant94/digital-garden-blog:2.0.0
# build:
# dockerfile: ./packages/blog/Dockerfile
build:
dockerfile: ./packages/blog/Dockerfile
container_name: blog
hostname: blog
restart: unless-stopped
Expand Down
23 changes: 23 additions & 0 deletions fly.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
app = 'digital-garden-blog'
primary_region = 'waw'

[build]
dockerfile = "./packages/blog/Dockerfile"

[env]
NODE_ENV = "production"
PORT = 3000
BASE_URL = "https://www.vorant94.io"

[http_service]
internal_port = 3000
force_https = true
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 1
processes = ['app']

[[vm]]
memory = '1gb'
cpu_kind = 'shared'
cpus = 1
Loading

0 comments on commit db861b0

Please sign in to comment.