Skip to content
This repository has been archived by the owner on Jan 25, 2024. It is now read-only.

Commit

Permalink
Deploy continuously
Browse files Browse the repository at this point in the history
  • Loading branch information
floriandejonckheere committed Dec 4, 2023
1 parent 1ae004d commit d64f1bb
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 11 deletions.
33 changes: 27 additions & 6 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
push:
branches:
- master
workflow_dispatch:

jobs:
ci:
Expand Down Expand Up @@ -44,6 +45,8 @@ jobs:
- ci

steps:
- uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

Expand All @@ -52,16 +55,34 @@ jobs:
with:
driver-opts: image=moby/buildkit:master

- name: Login to Github Packages
- name: Login to Github Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: Build and push app to GitHub Packages
uses: docker/build-push-action@v5
# - name: Build and push app to GitHub Container Registry
# uses: docker/build-push-action@v5
# with:
# file: Dockerfile
# push: true
# tags: ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:latest

- name: Set up Docker context
uses: amirmarmul/docker-context-ssh-action@v2
with:
file: Dockerfile
push: true
tags: ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:latest
ssh-host: ${{ secrets.SSH_HOST }}
ssh-username: ${{ secrets.SSH_USER }}
ssh-private-key: ${{ secrets.SSH_KEY }}
context-name: cloud
context-use: true

- name: Deploy application
env:
GHCR_USER: ${{ secrets.GHCR_TOKEN }}
GHCR_TOKEN: ${{ secrets.GHCR_TOKEN }}
COMPOSE_PROJECT_NAME: ${{ github.event.repository.name }}
run: |
docker-compose pull --quiet
docker-compose up --detach app
13 changes: 10 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,25 @@ version: "3.11"
services:
app:
image: ghcr.io/floriandejonckheere/wattson:latest
networks:
- fcloud
restart: unless-stopped
labels:
traefik.enable: "true"
traefik.http.middlewares.wattson-tls.redirectscheme.scheme: "https"

traefik.http.routers.wattson.rule: "Host(`wattson.florian.dejonckhee.re`)"
traefik.http.routers.wattson.rule: "Host(`wattson.dejonckhee.re`)"
traefik.http.routers.wattson.entrypoints: "web"
traefik.http.routers.wattson.middlewares: "wattson-tls"

traefik.http.routers.wattson-tls.rule: "Host(`wattson.florian.dejonckhee.re`)"
traefik.http.routers.wattson-tls.rule: "Host(`wattson.dejonckhee.re`)"
traefik.http.routers.wattson-tls.entrypoints: "websecure"
traefik.http.routers.wattson-tls.tls: "true"
traefik.http.routers.wattson-tls.tls.certresolver: "letsencrypt"

traefik.http.services.wattson.loadbalancer.server.port: "80"
traefik.http.services.wattson.loadbalancer.server.port: "8080"

networks:
fcloud:
external: true
name: "fcloud_default"
3 changes: 1 addition & 2 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
server {
listen 80;
listen [::]:80;
listen 8080;

# CORS proxy
location /api {
Expand Down

0 comments on commit d64f1bb

Please sign in to comment.