Add CI/CD
This commit is contained in:
parent
a4fd809ef5
commit
864d723c08
3
.dockerignore
Normal file
3
.dockerignore
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
.cache/
|
||||||
|
node_modules/
|
||||||
|
public/
|
64
.drone.yml
Normal file
64
.drone.yml
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: build
|
||||||
|
trigger:
|
||||||
|
event:
|
||||||
|
- push
|
||||||
|
steps:
|
||||||
|
- name: tag-image
|
||||||
|
image: alpine
|
||||||
|
commands:
|
||||||
|
- echo '${DRONE_COMMIT:0:8},latest' > .tags
|
||||||
|
- name: clone-submodules
|
||||||
|
image: alpine/git
|
||||||
|
commands:
|
||||||
|
- git submodule update --init --recursive
|
||||||
|
- name: build-image
|
||||||
|
image: plugins/docker
|
||||||
|
settings:
|
||||||
|
username:
|
||||||
|
from_secret: docker_user
|
||||||
|
password:
|
||||||
|
from_secret: docker_token
|
||||||
|
registry:
|
||||||
|
from_secret: registry_host
|
||||||
|
repo:
|
||||||
|
from_secret: local_repo
|
||||||
|
insecure: true
|
||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
type: ssh
|
||||||
|
name: deploy
|
||||||
|
depends_on:
|
||||||
|
- build
|
||||||
|
trigger:
|
||||||
|
branch:
|
||||||
|
- senpai
|
||||||
|
event:
|
||||||
|
- push
|
||||||
|
server:
|
||||||
|
host:
|
||||||
|
from_secret: ssh_host
|
||||||
|
user:
|
||||||
|
from_secret: ssh_user
|
||||||
|
ssh_key:
|
||||||
|
from_secret: ssh_key
|
||||||
|
steps:
|
||||||
|
- name: deploy
|
||||||
|
when:
|
||||||
|
branch:
|
||||||
|
- senpai
|
||||||
|
environment:
|
||||||
|
DOCKER_USER:
|
||||||
|
from_secret: docker_user
|
||||||
|
DOCKER_PASS:
|
||||||
|
from_secret: docker_token
|
||||||
|
REGISTRY_HOST:
|
||||||
|
from_secret: registry_host
|
||||||
|
IMAGE: infoscreen:latest
|
||||||
|
commands:
|
||||||
|
#- docker login -u $${DOCKER_USER} -p $${DOCKER_PASS}
|
||||||
|
- docker-compose -p infoscreen -f docker-compose.yml rm -s -v -f
|
||||||
|
- docker rmi $${REGISTRY_HOST}/$${IMAGE} || true
|
||||||
|
- docker pull $${REGISTRY_HOST}/$${IMAGE}
|
||||||
|
- docker-compose -p infoscreen -f docker-compose.yml up --no-build -d
|
4
Dockerfile
Normal file
4
Dockerfile
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
FROM gatsbyjs/gatsby:onbuild as build
|
||||||
|
|
||||||
|
FROM gatsbyjs/gatsby
|
||||||
|
COPY --from=build /app/public /pub
|
8
docker-compose.yml
Normal file
8
docker-compose.yml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
version: '3'
|
||||||
|
|
||||||
|
services:
|
||||||
|
server:
|
||||||
|
image: localhost:5000/infoscreen:latest
|
||||||
|
restart: always
|
||||||
|
ports:
|
||||||
|
- 11460:80 # 1, 14th char in alphabet, 6th char in alphabet, 0
|
Loading…
Reference in New Issue
Block a user