Add Github Actions
This commit is contained in:
12
.drone.yml
12
.drone.yml
@@ -1,12 +0,0 @@
|
|||||||
pipeline:
|
|
||||||
build:
|
|
||||||
image: plugins/docker
|
|
||||||
repo: 192.168.1.45:5000/mrflutters/fluttershub.com
|
|
||||||
tags:
|
|
||||||
- 1.0.0
|
|
||||||
- 1.0
|
|
||||||
- latest
|
|
||||||
extra_hosts:
|
|
||||||
- "gitea.dockerhost.lan:192.168.1.45"
|
|
||||||
- "drone.dockerhost.lan:192.168.1.45"
|
|
||||||
- "dockerhost.lan:192.168.1.45"
|
|
||||||
34
.github/workflows/docker.yml
vendored
Normal file
34
.github/workflows/docker.yml
vendored
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
name: Docker Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
env:
|
||||||
|
IMAGE_REPO: ghcr.io/hotarublaze
|
||||||
|
IMAGE_NAME: fluttershub
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
main:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
# If running with act, Uncomment below
|
||||||
|
# container: phaze9/action-runner
|
||||||
|
env:
|
||||||
|
DOCKER_CONFIG: $HOME/.docker
|
||||||
|
steps:
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v1
|
||||||
|
|
||||||
|
- name: Login to ghcr.io
|
||||||
|
uses: docker/login-action@v1
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: HotaruBlaze
|
||||||
|
password: ${{ secrets.CR_PAT }}
|
||||||
|
|
||||||
|
- name: Build and push
|
||||||
|
id: docker_build
|
||||||
|
uses: docker/build-push-action@v2
|
||||||
|
with:
|
||||||
|
push: true
|
||||||
|
tags: ${{ env.IMAGE_REPO }}/${{ env.IMAGE_NAME }}:latest
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
# This file is a template, and might need editing before it works on your project.
|
|
||||||
# Official docker image.
|
|
||||||
image: docker:latest
|
|
||||||
services:
|
|
||||||
- docker:dind
|
|
||||||
|
|
||||||
variables:
|
|
||||||
DOCKER_DRIVER: overlay2
|
|
||||||
|
|
||||||
before_script:
|
|
||||||
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
|
|
||||||
|
|
||||||
build-master:
|
|
||||||
stage: build
|
|
||||||
script:
|
|
||||||
- docker build --pull -t "$CI_REGISTRY_IMAGE" .
|
|
||||||
- docker push "$CI_REGISTRY_IMAGE"
|
|
||||||
only:
|
|
||||||
- master
|
|
||||||
|
|
||||||
# build-dev:
|
|
||||||
# stage: build
|
|
||||||
# script:
|
|
||||||
# - docker build --pull -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" . --label traefik.frontend.rule="Host:www.dev.${DOMAIN}" --label "traefik.backend=${CI_COMMIT_SHORT_SHA}-${CI_COMMIT_REF_SLUG}-${DOMAIN}"
|
|
||||||
# - docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
|
|
||||||
# only:
|
|
||||||
# - dev
|
|
||||||
|
|
||||||
# build:
|
|
||||||
# stage: build
|
|
||||||
# script:
|
|
||||||
# - docker build --pull -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" . --label traefik.frontend.rule="Host:${CI_COMMIT_REF_SLUG}.dev.${DOMAIN}" --label "traefik.backend=${CI_COMMIT_SHORT_SHA}-${CI_COMMIT_REF_SLUG}-${DOMAIN}"
|
|
||||||
# - docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
|
|
||||||
# except:
|
|
||||||
# - master
|
|
||||||
# - dev
|
|
||||||
14
Dockerfile
14
Dockerfile
@@ -1,5 +1,5 @@
|
|||||||
FROM node:11.1.0-alpine AS base
|
FROM node:14.15.3-alpine AS base
|
||||||
LABEL version="4.0.0"
|
LABEL version="4.1.0"
|
||||||
LABEL description=""
|
LABEL description=""
|
||||||
|
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
@@ -7,21 +7,21 @@ COPY ["package.json", "./"]
|
|||||||
COPY ["package-lock.json", "./"]
|
COPY ["package-lock.json", "./"]
|
||||||
|
|
||||||
FROM base AS builder
|
FROM base AS builder
|
||||||
RUN npm set progress=false && npm config set depth 0 && npm ci
|
RUN npm set progress=false && npm config set depth 0 && npm run preinit && npm ci
|
||||||
COPY ["src/", "./src"]
|
COPY ["src/", "./src"]
|
||||||
RUN npm run Prod
|
RUN npm run Prod
|
||||||
|
|
||||||
FROM nginx:1.16.0-alpine as Web
|
FROM nginx:1.19.6-alpine as Web
|
||||||
LABEL maintainer="MrFlutters (https://github.com/MrFlutters)"
|
LABEL maintainer="Phoenix (https://github.com/HotaruBlaze)"
|
||||||
COPY docker/nginx.conf /etc/nginx/nginx.conf
|
COPY docker/nginx.conf /etc/nginx/nginx.conf
|
||||||
COPY docker/web.conf /etc/nginx/conf.d/web.conf
|
COPY docker/web.conf /etc/nginx/conf.d/web.conf
|
||||||
|
|
||||||
LABEL com.centurylinklabs.watchtower.enable="true"
|
LABEL com.ouroboros.enable="true"
|
||||||
LABEL traefik.http.routers.fluttershub-com.tls=true
|
LABEL traefik.http.routers.fluttershub-com.tls=true
|
||||||
LABEL traefik.http.routers.fluttershub-com.rule=Host(`fluttershub.com`)
|
LABEL traefik.http.routers.fluttershub-com.rule=Host(`fluttershub.com`)
|
||||||
LABEL traefik.http.routers.fluttershub-com.tls.certresolver=letsencrypt
|
LABEL traefik.http.routers.fluttershub-com.tls.certresolver=letsencrypt
|
||||||
LABEL traefik.http.services.fluttershub-com.loadbalancer.server.port=80
|
LABEL traefik.http.services.fluttershub-com.loadbalancer.server.port=80
|
||||||
LABEL traefik.port=80
|
LABEL traefik.enable=true
|
||||||
|
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|||||||
@@ -7,12 +7,8 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- external
|
- external
|
||||||
container_name: fluttershub.com
|
container_name: fluttershub.com
|
||||||
# www.dev.fluttershub.com:
|
labels:
|
||||||
# image: registry.gitlab.com/mrflutters/fluttershub:dev
|
- "traefik.enable=true"
|
||||||
# restart: always
|
|
||||||
# networks:
|
|
||||||
# - external
|
|
||||||
# container_name: www.dev.fluttershub.com
|
|
||||||
networks:
|
networks:
|
||||||
external:
|
external:
|
||||||
external: true
|
external: true
|
||||||
|
|||||||
19
package-lock.json
generated
19
package-lock.json
generated
@@ -4552,10 +4552,8 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node-forge": {
|
"node-forge": {
|
||||||
"version": "0.7.6",
|
"dev": true,
|
||||||
"resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.7.6.tgz",
|
"version": "0.10.0"
|
||||||
"integrity": "sha512-sol30LUpz1jQFBjOKwbjxijiE3b6pjd74YwfD0fJOKPjF+fONKb2Yg8rYgS6+bK6VDl+/wfr4IYpC7jDzLUIfw==",
|
|
||||||
"dev": true
|
|
||||||
},
|
},
|
||||||
"node-libs-browser": {
|
"node-libs-browser": {
|
||||||
"version": "2.2.1",
|
"version": "2.2.1",
|
||||||
@@ -4909,7 +4907,7 @@
|
|||||||
"json5": "^1.0.1",
|
"json5": "^1.0.1",
|
||||||
"micromatch": "^3.0.4",
|
"micromatch": "^3.0.4",
|
||||||
"mkdirp": "^0.5.1",
|
"mkdirp": "^0.5.1",
|
||||||
"node-forge": "^0.7.1",
|
"node-forge": "0.10.0",
|
||||||
"node-libs-browser": "^2.0.0",
|
"node-libs-browser": "^2.0.0",
|
||||||
"opn": "^5.1.0",
|
"opn": "^5.1.0",
|
||||||
"postcss": "^7.0.11",
|
"postcss": "^7.0.11",
|
||||||
@@ -4925,6 +4923,11 @@
|
|||||||
"terser": "^3.7.3",
|
"terser": "^3.7.3",
|
||||||
"v8-compile-cache": "^2.0.0",
|
"v8-compile-cache": "^2.0.0",
|
||||||
"ws": "^5.1.1"
|
"ws": "^5.1.1"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"node-forge": {
|
||||||
|
"version": "0.10.0"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"parse-asn1": {
|
"parse-asn1": {
|
||||||
@@ -6080,9 +6083,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"sass": {
|
"sass": {
|
||||||
"version": "1.26.11",
|
"version": "1.30.0",
|
||||||
"resolved": "https://registry.npmjs.org/sass/-/sass-1.26.11.tgz",
|
"resolved": "https://registry.npmjs.org/sass/-/sass-1.30.0.tgz",
|
||||||
"integrity": "sha512-W1l/+vjGjIamsJ6OnTe0K37U2DBO/dgsv2Z4c89XQ8ZOO6l/VwkqwLSqoYzJeJs6CLuGSTRWc91GbQFL3lvrvw==",
|
"integrity": "sha512-26EUhOXRLaUY7+mWuRFqGeGGNmhB1vblpTENO1Z7mAzzIZeVxZr9EZoaY1kyGLFWdSOZxRMAufiN2mkbO6dAlw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"chokidar": ">=2.0.0 <4.0.0"
|
"chokidar": ">=2.0.0 <4.0.0"
|
||||||
|
|||||||
14
package.json
14
package.json
@@ -4,12 +4,13 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"description": "My personal website for fluttershub.com",
|
"description": "My personal website for fluttershub.com",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"author": "MrFlutters",
|
"author": "HotaruBlaze",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git@gitlab.com:MrFlutters/Fluttershub.git"
|
"url": "git@github.com:github/Fluttershub.git"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"preinit": "npx npm-force-resolutions",
|
||||||
"Dev": "npm run Cleanup && npm run Init && parcel dev src/index.pug -d build",
|
"Dev": "npm run Cleanup && npm run Init && parcel dev src/index.pug -d build",
|
||||||
"Cleanup": "rm -Rf build/ .cache/",
|
"Cleanup": "rm -Rf build/ .cache/",
|
||||||
"Init": "mkdir build && cp -R src/assets/* build/",
|
"Init": "mkdir build && cp -R src/assets/* build/",
|
||||||
@@ -18,15 +19,18 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"parcel-bundler": "^1.12.4",
|
"parcel-bundler": "^1.12.4",
|
||||||
"pug": "^2.0.4",
|
"pug": "^2.0.4",
|
||||||
"sass": "^1.26.11"
|
"sass": "^1.30.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "11.*"
|
"node": "14.*"
|
||||||
|
},
|
||||||
|
"resolutions": {
|
||||||
|
"node-forge": "0.10.0"
|
||||||
},
|
},
|
||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://gitlab.com/MrFlutters/Fluttershub/issues"
|
"url": "https://github.com/hotarublaze/Fluttershub/issues"
|
||||||
},
|
},
|
||||||
"homepage": "https://fluttershub.com"
|
"homepage": "https://fluttershub.com"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user