-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtaskfile.yml
More file actions
144 lines (125 loc) · 4.62 KB
/
taskfile.yml
File metadata and controls
144 lines (125 loc) · 4.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
version: '3'
tasks:
blog-convert-logotypes:
desc: Convert SVG logotypes to PNG using Inkscape
cmds:
- for f in static/assets/images/logotypes/*.svg; do inkscape -w 750 "$f" --export-background white --export-background-opacity 1 --export-type png --export-filename "static/assets/images/structured-data/$(basename ${f%.*})-750.png"; done
blog-generate-styles:
desc: Generate CSS styles from LESS and Hugo chromastyles
cmds:
- npm run less-main
- hugo gen chromastyles --style=github > themes/bitix/static/assets/css/syntax.css
blog-git-apply:
desc: Apply a Git patch from Downloads
cmds:
- git apply ~/Descargas/Backup/post.patch
blog-git-small-changes:
desc: Commit and push small changes
cmds:
- git add .
- git commit -m "Pequeños retoques"
- git push origin main
blog-reset-deploy:
desc: Reset the deploy directory with a fresh Git repository
cmds:
- mv deploy/ deploy-backup/
- mkdir deploy/
- cd deploy/ && git init -b gh-pages
- cd deploy/ && git remote add origin git@github.com:picodotdev/blog-bitix.git
- cd deploy/ && git config --local user.email "pico.dev@gmail.com"
- cd deploy/ && git config --local user.name "pico.dev"
- cd deploy/ && git config --local pull.ff only
- cd deploy/ && git checkout -b gh-pages
- cp deploy-backup/.gitignore deploy/.gitignore
- task: site-build
- cd deploy/ && git add -A
- cd deploy/ && git commit -m "Site reset at $(LC_ALL=en_US.utf8 date +%Y-%m-%dT%H:%M:%S%z)"
- cd deploy/ && git push --force origin gh-pages
- task: site-update-build-deploy
blog-reset-master:
desc: Reset the master branch with a new Git repository
cmds:
- rm -rf .git
- git init -b main
- git add .
- git commit -m "Initial commit"
- git remote add origin git@github.com:picodotdev/blog-bitix.git
- git push -u --force origin master
new:
desc: Create a new Hugo post
cmds:
- hugo --source="." --theme="bitix" new {{.CLI_ARGS}}
npm-update:
desc: Update npm dependencies
cmds:
- ./node_modules/npm-check-updates/bin/ncu -u
- npm install
- npm audit fix
server:
desc: Run Hugo development server
cmds:
- hugo server --buildDrafts --buildFuture --watch --disableLiveReload --gc
site-build:
desc: Build the Hugo site
deps:
- blog-generate-styles
cmds:
- hugo --destination="deploy" --gc --cleanDestinationDir
- cp deploy/index.xml deploy/atom.xml
- mkdir -p deploy/categories/planeta-codigo/
- cp deploy/tags/planeta-codigo/index.xml deploy/categories/planeta-codigo/atom.xml
site-check-firefox:
desc: Take screenshots of links using Firefox headless
cmds:
- |
cat check-firefox-links.txt | while read -r LINE; do
NAME=$(echo $LINE | cut -d , -f 1)
URL=$(echo $LINE | cut -d , -f 2)
firefox -P headless -headless --screenshot "$NAME.png" $URL --window-size=1920
done
site-check-links:
desc: Check external links using linkchecker
cmds:
- docker run --rm -it linkchecker/linkchecker --verbose --check-extern https://picodotdev.github.io/blog-bitix/ > linkchecker.log
site-clean-deploy:
desc: Clean the deploy directory and rebuild
cmds:
- rm -r deploy/*
- task: site-build
site-clean-public:
desc: Clean the public directory and rebuild
cmds:
- rm -r public/*
- task: site-build
site-deploy:
desc: Deploy the site to GitHub Pages
dir: deploy
cmds:
- git add .
- git commit -m "Site update at $(LC_ALL=en_US.utf8 date +%Y-%m-%dT%H:%M:%S%z)"
- git push origin gh-pages
site-install:
desc: Initial setup - clone repository and install dependencies
cmds:
- git clone -b master git@github.com:picodotdev/blog-bitix.git
- cd blog-bitix && git config --local user.email "pico.dev@gmail.com"
- cd blog-bitix && git config --local user.name "pico.dev"
- cd blog-bitix && npm install
- git clone -b gh-pages git@github.com:picodotdev/blog-bitix.git deploy/
- cd deploy && git config --local user.email "pico.dev@gmail.com"
- cd deploy && git config --local user.name "pico.dev"
site-sync:
desc: Synchronize - update, build and deploy
cmds:
- task: site-update-build-deploy
site-update:
desc: Update the deploy directory from remote
dir: deploy
cmds:
- git pull origin gh-pages
site-update-build-deploy:
desc: Update, build and deploy the site
cmds:
- task: site-update
- task: site-build
- task: site-deploy