Skip to content

Commit 5a23263

Browse files
authored
Add action (#14)
* Delete appveyor.yml * Delete .travis.yml * Update Readme.md * move robots.txt & .htaccess * fix issue with CSP & robots.txt * simplify working with assets * fix package min version of node
1 parent b4a196b commit 5a23263

10 files changed

+83
-66
lines changed

.github/workflows/nodejs.yml

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: deployment
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@master
10+
- uses: actions/setup-node@master
11+
with:
12+
node-version: 13.x
13+
- run: npm i
14+
- run: npx hexo g
15+
- uses: actions/upload-artifact@master
16+
with:
17+
path: public
18+
name: public
19+
deploy-firebase:
20+
runs-on: ubuntu-latest
21+
needs: build
22+
if: github.ref == 'master'
23+
steps:
24+
- run: set FIREBASE_TOKEN=${{ secrets.FIREBASE_TOKEN }}
25+
- uses: actions/checkout@master
26+
- uses: actions/setup-node@master
27+
with:
28+
node-version: 13.x
29+
- uses: actions/download-artifact@master
30+
with:
31+
name: public
32+
- run: |
33+
cp assets/indexing-on.txt public/robots.txt
34+
npm i -g firebase-tools
35+
firebase deploy
36+
37+
deploy-ovh:
38+
runs-on: ubuntu-latest
39+
needs: build
40+
if: github.ref == 'master'
41+
steps:
42+
- uses: actions/checkout@master
43+
- uses: actions/download-artifact@master
44+
with:
45+
name: public
46+
- name: ftp
47+
run: |
48+
cp assets/indexing-off.txt public/robots.txt
49+
cp assets/.htaccess public/.htaccess
50+
find public -type f -exec curl --user xntprja:${{ secrets.FTP_PASSWORD }} --ftp-create-dirs -T {} ftp://@ftp.cluster014.hosting.ovh.net:21/www/{} \;
51+
52+
deploy-github:
53+
runs-on: ubuntu-latest
54+
needs: build
55+
if: github.ref == 'master'
56+
steps:
57+
- uses: actions/checkout@master
58+
- uses: actions/download-artifact@master
59+
with:
60+
name: public
61+
- name: gh
62+
run: |
63+
git clone https://github.com/tomap/tomap.github.io.git
64+
rm -r tomap.github.io/*
65+
cp assets/indexing-off.txt public/robots.txt
66+
cp -a public/. tomap.github.io
67+
cd tomap.github.io
68+
git status
69+
git add .
70+
git config -l
71+
git config --global user.email "${{ secrets.GITHUB_EMAIL }}"
72+
git config --global user.name "tomap"
73+
git commit -m "Update site"
74+
git remote add origin-pages https://tomap:${{ secrets.GH_TOKEN }}@github.com/tomap/tomap.github.io.git
75+
git push --set-upstream origin-pages master
76+

.travis.yml

-17
This file was deleted.

Readme.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22

33
[![Dependency Status](https://david-dm.org/tomap/tpi2.eu.svg)](https://david-dm.org/tomap/tpi2.eu)
44
[![Dependency Status](https://david-dm.org/tomap/tpi2.eu/dev-status.svg)](https://david-dm.org/tomap/tpi2.eu?type=dev)
5-
[![AppVeyor Build status](https://ci.appveyor.com/api/projects/status/amvptl7n6hj3j8i6?svg=true)](https://ci.appveyor.com/project/tomap/tpi2-eu)
6-
[![Travis-ci Build status](https://travis-ci.org/tomap/tpi2.eu.svg?branch=master)](https://travis-ci.org/tomap/tpi2.eu)
7-
[![Codeship Build Status](https://app.codeship.com/projects/faf92df0-2f86-0136-7ebd-1220cc68bc4e/status?branch=master)](https://app.codeship.com/projects/288400)
5+
[![GitHub Actions Status](https://github.com/tomap/tpi2.eu/workflows/nodejs/badge.svg)](https://github.com/tomap/tpi2.eu/actions)
86

97
## How To
108

@@ -13,7 +11,7 @@ To launch this website:
1311
- clone this repo
1412
- run ```npm i```
1513
- run ```npx hexo s -o``` (to run locally)
16-
- run ```npx hexo g``` (to generate into Public folder)
14+
- run ```npx hexo g``` (to generate into `public` folder)
1715

1816
## License
1917

_config.yml

-4
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ root: /
1515
# Directory
1616
skip_render:
1717
- 'assets/404.html'
18-
- 'googlec312aa49c107e0a6.html'
19-
20-
include:
21-
- .htaccess
2218

2319
# Writing
2420
highlight:

appveyor.yml

-28
This file was deleted.

source/.htaccess assets/.htaccess

File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
User-agent: *
2-
Disallow: /
2+
Disallow: /
File renamed without changes.

firebase.json

+2-9
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
11
{
22
"hosting": {
33
"public": "public",
4-
"ignore": [
5-
"firebase.json",
6-
"**/.*",
7-
"**/node_modules/**",
8-
"**/.htaccess",
9-
"**/google*.html"
10-
],
114
"headers": [ {
12-
"source" : "**/*.@(eot|otf|ttf|ttc|woff|woff2|svg|ico)",
5+
"source" : "**/*.@(ico)",
136
"headers" : [ {
147
"key" : "Cache-Control",
158
"value" : "max-age=365000000, immutable"
@@ -18,7 +11,7 @@
1811
{
1912
"source":"**",
2013
"headers": [
21-
{"key":"Content-Security-Policy","value":"default-src 'none'; style-src 'self'; img-src * data:"},
14+
{"key":"Content-Security-Policy","value":"default-src 'none'; style-src 'self'; img-src * data:; connect-src 'self'"},
2215
{"key":"Referrer-Policy","value":"no-referrer"},
2316
{"key":"X-Frame-Options","value":"deny"}
2417
]

package.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,10 @@
2424
"glob": "^7.1.4"
2525
},
2626
"engines": {
27-
"node": ">= 8.6.0"
27+
"node": ">= 8.10.0"
2828
},
2929
"scripts": {
30-
"generateTravis": "hexo g && mv public/assets/404.html public/404.html",
31-
"generateCopy": "hexo g && cp indexing/robots.txt public/robots.txt && cp public/assets/404.html public/404.html && rm public/.htaccess",
30+
"build": "hexo g",
3231
"installClean": "rm -rf node_modules/hexo-generator-feed && rm -rf node_modules/hexo-clean-css && rm -rf node_modules/hexo-html-minifier && npm i"
3332
}
3433
}

0 commit comments

Comments
 (0)