Replaced docker with netlify deployment (#75)

This commit is contained in:
Thomas Boerger 2018-07-11 23:01:59 +02:00 committed by Jonas Franz
parent 8bc554bfa5
commit d2fcda850e
7 changed files with 29 additions and 84 deletions

View File

@ -2,6 +2,9 @@ workspace:
base: /srv/app
path: src
branches:
- master
clone:
git:
image: plugins/git:1
@ -17,30 +20,19 @@ pipeline:
- make clean
- make build
docker:
image: plugins/docker:17.05
publish:
image: lucap/drone-netlify:latest
pull: true
secrets: [ docker_username, docker_password ]
repo: gitea/website
tags: [ '${DRONE_BRANCH##release/v}' ]
secrets: [ netlify_token ]
site_id: 05515f14-3702-4a84-9ff3-88ba90fe08dd
path: public/
when:
event: [ push ]
branch: [ release/* ]
docker:
image: plugins/docker:17.05
pull: true
secrets: [ docker_username, docker_password ]
repo: gitea/website
tags: [ 'latest' ]
when:
event: [ push ]
branch: [ master ]
discord:
image: appleboy/drone-discord:1.0.0
image: appleboy/drone-discord:1
pull: true
secrets: [ discord_webhook_id, discord_webhook_token ]
when:
event: [ push, tag, pull_request ]
event: [ push, tag ]
status: [ changed, failure ]

View File

@ -1,22 +0,0 @@
# build stage
FROM golang:alpine AS build-env
RUN apk add --no-cache git
RUN go get -d -v github.com/mholt/caddy/caddy github.com/pedronasser/caddy-search github.com/simia-tech/caddy-locale
WORKDIR /go/src/github.com/mholt/caddy/caddy
RUN sed -i '/This is where other plugins get plugged in (imported)/a _ "github.com/pedronasser/caddy-search"' caddymain/run.go \
&& sed -i '/This is where other plugins get plugged in (imported)/a _ "github.com/simia-tech/caddy-locale"' caddymain/run.go \
&& go install -v . \
&& /go/bin/caddy -version
FROM alpine:edge
EXPOSE 80
RUN apk add --no-cache wget mailcap ca-certificates
COPY --from=build-env /go/bin/caddy /usr/sbin/caddy
COPY docker/caddy.conf /etc/caddy.conf
COPY public /srv/www
CMD ["/usr/sbin/caddy", "-conf", "/etc/caddy.conf"]

View File

@ -32,7 +32,7 @@ menu:
pre: question
- name: API
url: https://try.gitea.io/api/swagger
weight: 25
weight: 45
pre: plug
- name: Blog
url: https://blog.gitea.io/
@ -80,7 +80,7 @@ languages:
pre: question
- name: API
url: https://try.gitea.io/api/swagger
weight: 25
weight: 45
pre: plug
- name: 博客
url: https://blog.gitea.io/
@ -123,7 +123,7 @@ languages:
pre: question
- name: API
url: https://try.gitea.io/api/swagger
weight: 25
weight: 45
pre: plug
- name: 部落格
url: https://blog.gitea.io/
@ -166,7 +166,7 @@ languages:
pre: question
- name: API
url: https://try.gitea.io/api/swagger
weight: 25
weight: 45
pre: plug
- name: Blog
url: https://blog.gitea.io/
@ -209,7 +209,7 @@ languages:
pre: question
- name: API
url: https://try.gitea.io/api/swagger
weight: 25
weight: 45
pre: plug
- name: Blog
url: https://blog.gitea.io/

View File

@ -1,39 +0,0 @@
:80 {
root /srv/www
locale en-US zh-CN zh-TW pt-BR nl-NL {
detect header
}
redir 301 {
if {path} match ^/$
/ /{>Detected-Locale}/
}
rewrite /en-US/ {
regexp (.*)
to /en-us/{1}
}
rewrite /zh-CN/ {
regexp (.*)
to /zh-cn/{1}
}
rewrite /zh-TW/ {
regexp (.*)
to /zh-tw/{1}
}
rewrite /pt-BR/ {
regexp (.*)
to /pt-br/{1}
}
rewrite /nl-NL/ {
regexp (.*)
to /nl-nl/{1}
}
header / Vary "Accept-Language"
}

View File

6
static/_headers Normal file
View File

@ -0,0 +1,6 @@
/*
Content-Security-Policy: default-src 'self'
X-Frame-Options: DENY
X-Xss-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Referrer-Policy: strict-origin-when-cross-origin

8
static/_redirects Normal file
View File

@ -0,0 +1,8 @@
https://gitea-website.netlify.com/* https://gitea.io/:splat 302!
https://www.gitea.io/* https://gitea.io/:splat 302!
/ /nl-nl/ 302! Language=nl
/ /pt-br/ 302! Language=pt-br
/ /zh-cn/ 302! Language=zh-cn
/ /zh-tw/ 302! Language=zh-tw
/ /en-us/ 302!