diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml new file mode 100644 index 0000000..ecd9741 --- /dev/null +++ b/.github/workflows/build-and-deploy.yml @@ -0,0 +1,46 @@ +name: Build and Deploy app + +on: + push: + branches: ["main"] + +concurrency: + group: ${{ github.ref }} + cancel-in-progress: true + +jobs: + build-and-push-image: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Docker Setup Buildx + uses: docker/setup-buildx-action@v2.2.1 + + - name: Log in to the Container registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push Frontend + uses: docker/build-push-action@v3 + with: + context: . + file: docker/frontend/Dockerfile + push: true + tags: "ghcr.io/${{ github.repository }}/frontend:latest" + + - name: pull and start new image + uses: appleboy/ssh-action@master + with: + host: ${{ secrets.HOST }} + username: ${{ secrets.USER_NAME }} + key: ${{ secrets.PRIVATE_KEY}} + script: cd c4s-website && docker compose pull && docker compose up -d diff --git a/content/_components/Footer.tsx b/content/_components/Footer.tsx index b73fb51..19a892f 100644 --- a/content/_components/Footer.tsx +++ b/content/_components/Footer.tsx @@ -3,17 +3,17 @@ export default ({ text }) => (
{text.footer_slogan}{" "} - Chaos Computer Club e.V. + Chaos Computer Club e.V.
- + {text.footer_imprint} {!text.footer_imprint && Impressum} {" "} &{" "} - + {text.footer_privacy} {!text.footer_privacy && Datenschutz} diff --git a/docker-compose.example.yml b/docker-compose.example.yml deleted file mode 100644 index ad303fd..0000000 --- a/docker-compose.example.yml +++ /dev/null @@ -1,17 +0,0 @@ -version: "3" - -services: - - frontend: - build: - context: ./ - dockerfile: "frontend.Dockerfile" - restart: always - volumes: - - ./nginx.conf:/etc/nginx/nginx.conf - expose: - - 8080 - ports: - - "8080:8080" - depends_on: - - api diff --git a/docker-compose.prod.yaml b/docker-compose.prod.yaml index aa4f212..72aac5d 100644 --- a/docker-compose.prod.yaml +++ b/docker-compose.prod.yaml @@ -3,21 +3,17 @@ version: "3.7" networks: web: external: true - c4s-website: services: - app: image: ghcr.io/chaostreff-flensburg/c4s-website/frontend:latest - restart: unless-stopped + restart: always networks: - web - - c4s-website labels: - - traefik.enable=true - - traefik.http.routers.c4s-website.rule=Host(`42.ccc.de`) - - traefik.http.routers.c4s-website.entrypoints=websecure - - traefik.http.routers.c4s-website.tls=true - - traefik.http.routers.c4s-website.certresolver=le - - traefik.http.services.c4s-website.loadbalancer.server.port=8080 - - traefik.docker.network=web + - "traefik.enable=true" + - "traefik.http.routers.c4s-website.rule=Host(`42.ccc.de`)" + - "traefik.http.routers.c4s-website.entrypoints=https,http" + - "traefik.http.services.c4s-website.loadbalancer.server.port=80" + - "traefik.http.routers.c4s-website.tls.certresolver=mytlschallenge" + - "traefik.docker.network=web" diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..9e96424 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,10 @@ +version: "3" + +services: + frontend: + build: + context: . + dockerfile: "docker/frontend/Dockerfile" + restart: always + ports: + - "8080:8080" diff --git a/docker/frontend/Dockerfile b/docker/frontend/Dockerfile index 01870ec..2a04da2 100644 --- a/docker/frontend/Dockerfile +++ b/docker/frontend/Dockerfile @@ -11,7 +11,6 @@ RUN deno cache build.ts ADD . . RUN deno task build - # build nginx webserver FROM nginx:alpine diff --git a/docker/frontend/nginx.conf b/docker/frontend/nginx.conf index da89686..7fc5dc5 100644 --- a/docker/frontend/nginx.conf +++ b/docker/frontend/nginx.conf @@ -20,12 +20,12 @@ http { # tcp_nopush on; keepalive_timeout 3; # tcp_nodelay on; -# gzip on; + gzip on; client_max_body_size 1m; server { - listen 8080 default_server; + listen 80 default_server; server_name _; location / {