Skip to content

Instantly share code, notes, and snippets.

View diyor28's full-sized avatar

Diyor Khaydarov diyor28

View GitHub Profile
name: Cleanup on branch removal
on: [ delete ]
jobs:
build:
runs-on: [ self-hosted, staging ]
steps:
- uses: actions/checkout@v2
- name: Cleanup
@diyor28
diyor28 / Dockerfile
Created May 30, 2021 21:26
Vue sample app Dockerfile
FROM bitnami/git:latest
FROM node:12.18.2-alpine3.9 as build-stage
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn install --pure-lockfile --non-interactive && yarn global add @vue/cli
ARG VUE_APP_BASE_URL
COPY . .
RUN NODE_OPTIONS=--max_old_space_size=4096 yarn build --mode staging
@diyor28
diyor28 / config.yml
Last active May 31, 2021 02:10
Traefik dynamic configuration
tls:
certificates:
- certFile: /etc/letsencrypt/live/stg.example.com/fullchain.pem
keyFile: /etc/letsencrypt/live/stg.example.com/privkey.pem
- certFile: /etc/letsencrypt/live/traefik.example.com/fullchain.pem
keyFile: /etc/letsencrypt/live/traefik.example.com/privkey.pem
@diyor28
diyor28 / build.yml
Last active May 30, 2021 21:29
Github Actions build on push with Docker.
name: Build and deploy to staging # Will be displayed in Github's Actions tab.
on: [ push ] # On which events to trigger this workflow.
jobs: # Defines what to run.
build:
runs-on: [ self-hosted, staging ]
steps:
- name: Get branch name (merge)
if: github.event_name != 'pull_request'
@diyor28
diyor28 / docker-compose.yml
Last active May 30, 2021 21:54
docker-compose for sample Vue application
version: '3.8'
services:
front:
container_name: front_${COMPOSE_PROJECT_NAME}
image: front:${COMPOSE_PROJECT_NAME}
build:
context: ./
args:
- VUE_APP_BASE_URL=/${COMPOSE_PROJECT_NAME}/
@diyor28
diyor28 / docker-compose.yml
Last active May 30, 2021 21:39
Traefik docker-compose
version: '3.8'
services:
reverse-proxy:
image: traefik:v2.4
restart: always
ports:
- "80:80"
- "443:443"
labels:
@diyor28
diyor28 / traefik.yml
Last active May 30, 2021 20:34
Traefik static configuration
defaultEntryPoints: # makes the 443 port default.
- websecure
entryPoints:
web: # defines an entrypoint called web
address: :80 # use port 80
http:
redirections: # redirect to entrypoint websecure
entryPoint:
to: websecure