Skip to content

Commit c1cd052

Browse files
committed
🚀 docker package build
1 parent 8915b18 commit c1cd052

File tree

3 files changed

+39
-7
lines changed

3 files changed

+39
-7
lines changed

‎.circleci/config.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Javascript Node CircleCI 2.0 configuration file
2+
3+
version: 2
4+
jobs:
5+
build:
6+
docker:
7+
- image: node:10-alpine3.11
8+
working_directory: ~/build
9+
steps:
10+
- run:
11+
name: Install dependencies
12+
command: apk add docker-cli git python2 g++ make openssh-client
13+
- checkout
14+
- run:
15+
name: Build
16+
command: |
17+
npm ci && npm run generate && cd api && npm ci && npm run generate
18+
- setup_remote_docker:
19+
- run:
20+
name: Build and push images
21+
command: |
22+
docker login -u _json_key -p "$GCRIO_KEY" https://gcr.io
23+
docker build -t gcr.io/screeps-test/docs:$CIRCLE_BUILD_NUM -f ~/build/Dockerfile ~/build
24+
docker push gcr.io/screeps-test/docs:$CIRCLE_BUILD_NUM
25+
- run:
26+
name: Tag commits
27+
command: |
28+
git tag build-$CIRCLE_BUILD_NUM && git push origin --tags
29+
30+
workflows:
31+
version: 2
32+
production:
33+
jobs:
34+
- build:
35+
context: production

‎Dockerfile

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
FROM nginxinc/nginx-unprivileged:1.16-alpine
2+
3+
COPY public /usr/share/nginx/html

‎api/scripts/helper-is_ptr.js

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
11

22
hexo.extend.helper.register('is_ptr', function() {
3-
try {
4-
require('../../.ptr');
5-
return true;
6-
}
7-
catch(e) {
8-
return false;
9-
}
3+
return process.env.IS_PTR === "1";
104
});

0 commit comments

Comments
 (0)