-
Notifications
You must be signed in to change notification settings - Fork 1
95 lines (92 loc) · 3.26 KB
/
gh-pages.yml
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
name: Build and deploy lynkos.dev
on:
push:
branches:
- main
workflow_dispatch: # allows manual execution of workflow
defaults:
run:
shell: bash
jobs:
build-and-deploy:
runs-on: ubuntu-latest
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4
- name: Setup Node
id: setup-node
uses: actions/setup-node@v4
with:
node-version: 'latest'
cache: 'npm'
check-latest: true
- name: Cache dependencies
id: cache
uses: actions/cache@v4
with:
path: |
~/.npm
node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
id: install
run: npm install
- name: Build
id: build
run: npm run build
- name: Generate sitemap.xml
id: sitemap
run: |
echo '<?xml version="1.0" encoding="UTF-8"?>' > sitemap.xml
echo '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' >> sitemap.xml
echo ' <url>' >> sitemap.xml
echo ' <loc>https://lynkos.dev/</loc>' >> sitemap.xml
echo -n ' <lastmod>' >> sitemap.xml
echo -n $(date '+%F') >> sitemap.xml
echo '</lastmod>' >> sitemap.xml
echo ' <changefreq>daily</changefreq>' >> sitemap.xml
echo ' <priority>1.00</priority>' >> sitemap.xml
echo ' </url>' >> sitemap.xml
echo -n '</urlset>' >> sitemap.xml
- name: Generate robots.txt
id: robots
run: |
echo 'User-agent: *' > robots.txt
echo 'Allow: /' >> robots.txt
echo '' >> robots.txt
echo 'User-agent: AdsBot-Google' >> robots.txt
echo 'Disallow: /' >> robots.txt
echo '' >> robots.txt
echo 'User-agent: AdsBot-Google-Mobile' >> robots.txt
echo 'Disallow: /' >> robots.txt
echo '' >> robots.txt
echo 'User-agent: Mediapartners-Google' >> robots.txt
echo 'Disallow: /' >> robots.txt
echo '' >> robots.txt
echo 'User-agent: Google-Extended' >> robots.txt
echo 'Disallow: /' >> robots.txt
echo '' >> robots.txt
echo 'User-agent: Google-CloudVertexBot' >> robots.txt
echo 'Disallow: /' >> robots.txt
echo '' >> robots.txt
echo -n 'Sitemap: https://lynkos.dev/sitemap.xml' >> robots.txt
- name: Deploy
id: deploy
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # commit hash of v4.0.0
if: github.ref == 'refs/heads/main'
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
publish_branch: prod
exclude_assets: '.github,.gitignore,README.md,LICENSE.md,node_modules,src,package.json,package-lock.json,assets/img/misc/pipeline.webp,assets/stylesheets/sass'
publish_dir: .
cname: lynkos.dev
disable_nojekyll: true
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'