mirror of
https://github.com/ditatompel/insights.git
synced 2025-01-08 03:12:06 +07:00
Compare commits
4 commits
f65922c6c0
...
b2d8898ce5
Author | SHA1 | Date | |
---|---|---|---|
|
b2d8898ce5 | ||
|
67d7509ff3 | ||
8822570740 | |||
|
fcb36ee5b9 |
4 changed files with 72 additions and 9 deletions
|
@ -1,7 +1,6 @@
|
|||
name: Deploy to VPS
|
||||
name: Production
|
||||
|
||||
on:
|
||||
# auto deploy when pushing to specified branches.
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
@ -10,14 +9,14 @@ on:
|
|||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
deploy:
|
||||
name: Build and copy to production server
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository_owner == 'ditatompel'
|
||||
environment: production
|
||||
permissions:
|
||||
contents: read
|
||||
deployments: write
|
||||
name: Build and copy to VPS
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
|
@ -55,10 +54,8 @@ jobs:
|
|||
|
||||
- name: Build
|
||||
run: hugo --minify --gc --enableGitInfo --cleanDestinationDir
|
||||
# Use following instead if defaultContentLanguageInSubdir is enabled.
|
||||
# run: hugo --minify --gc --enableGitInfo --cleanDestinationDir && cp public/en/404.html public/404.html
|
||||
|
||||
- name: Deploy website with rsync
|
||||
- name: Deploy
|
||||
uses: burnett01/rsync-deployments@5.2
|
||||
with:
|
||||
switches: -avzr --quiet --delete
|
64
.github/workflows/staging.yaml
vendored
Normal file
64
.github/workflows/staging.yaml
vendored
Normal file
|
@ -0,0 +1,64 @@
|
|||
name: Staging
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
# allow triggering workflow manually.
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
name: Build and copy to staging VPS
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository_owner == 'ditatompel'
|
||||
environment: staging
|
||||
permissions:
|
||||
contents: read
|
||||
deployments: write
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "20"
|
||||
|
||||
- name: Cache dependencies
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Setup Hugo
|
||||
uses: peaceiris/actions-hugo@v3
|
||||
with:
|
||||
hugo-version: "0.126.3"
|
||||
extended: true
|
||||
|
||||
- name: Cache Hugo modules
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: /tmp/hugo_cache
|
||||
key: ${{ runner.os }}-hugomod-${{ hashFiles('**/go.sum') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-hugomod-
|
||||
|
||||
- name: Build
|
||||
run: hugo --minify --gc --enableGitInfo --cleanDestinationDir
|
||||
|
||||
- name: Deploy to staging
|
||||
uses: burnett01/rsync-deployments@5.2
|
||||
with:
|
||||
switches: -avzr --quiet --delete
|
||||
path: public/
|
||||
remote_path: ${{ secrets.DEPLOY_PATH }}
|
||||
remote_host: ${{ secrets.DEPLOY_HOST }}
|
||||
remote_user: ${{ secrets.DEPLOY_USER }}
|
||||
remote_key: ${{ secrets.DEPLOY_KEY }}
|
4
go.mod
4
go.mod
|
@ -6,7 +6,7 @@ require (
|
|||
github.com/GoogleChrome/workbox v7.1.0+incompatible // indirect
|
||||
github.com/KaTeX/KaTeX v0.16.10 // indirect
|
||||
github.com/gohugoio/hugo-mod-bootstrap-scss/v5 v5.20300.20200 // indirect
|
||||
github.com/hbstack/base v0.6.0 // indirect
|
||||
github.com/hbstack/base v0.6.1 // indirect
|
||||
github.com/hbstack/blog/modules/content-panel v0.1.21 // indirect
|
||||
github.com/hbstack/blog/modules/toc-scrollspy v0.2.0 // indirect
|
||||
github.com/hbstack/carousel v0.2.5 // indirect
|
||||
|
@ -27,7 +27,7 @@ require (
|
|||
github.com/hugomods/giscus v0.1.1 // indirect
|
||||
github.com/hugomods/google-adsense v0.1.0 // indirect
|
||||
github.com/hugomods/gravatar v0.2.0 // indirect
|
||||
github.com/hugomods/hugopress v0.4.1 // indirect
|
||||
github.com/hugomods/hugopress v0.5.0 // indirect
|
||||
github.com/hugomods/icons/vendors/bootstrap v0.5.7 // indirect
|
||||
github.com/hugomods/icons/vendors/font-awesome v0.6.7 // indirect
|
||||
github.com/hugomods/idb-js v0.1.0 // indirect
|
||||
|
|
2
go.sum
2
go.sum
|
@ -7,6 +7,7 @@ github.com/gohugoio/hugo-mod-bootstrap-scss/v5 v5.20300.20200/go.mod h1:kx8MBj9T
|
|||
github.com/gohugoio/hugo-mod-jslibs-dist/popperjs/v2 v2.21100.20000/go.mod h1:mFberT6ZtcchrsDtfvJM7aAH2bDKLdOnruUHl0hlapI=
|
||||
github.com/hbstack/base v0.6.0 h1:kIMI5C7X1aTWffKnG9N5Db20O6DhjyztN5yAPIFFDbY=
|
||||
github.com/hbstack/base v0.6.0/go.mod h1:4A2bxdXMjpj4HSEnugN7hlFECiap4zUX56jOqtu4YPY=
|
||||
github.com/hbstack/base v0.6.1/go.mod h1:rDOIrQy8GKXqam3dvHPQnrvwadQByiGcDY1Q35wBrT4=
|
||||
github.com/hbstack/blog/modules/content-panel v0.1.21 h1:g43IVjn3O6QCQSvCbgr9iYCgZcI5XG8YAiuVPb269Ok=
|
||||
github.com/hbstack/blog/modules/content-panel v0.1.21/go.mod h1:fVnvVtnfo3R78jnGLgckfC43j7rYMMN+l1PhU9E6Jas=
|
||||
github.com/hbstack/blog/modules/toc-scrollspy v0.2.0 h1:UgA7UxoHTOzFDRp1XxhCmCNiSZlfpXqyEBnkPMCMjsM=
|
||||
|
@ -50,6 +51,7 @@ github.com/hugomods/gravatar v0.2.0/go.mod h1:oATWuh5u2XUK/ZKzOD0VEP5I/TZfVZwplT
|
|||
github.com/hugomods/hugopress v0.4.0 h1:ZNORTaUTdw3/AJdu3F280r9aM84c+tZyDQpcJOQJ7Ks=
|
||||
github.com/hugomods/hugopress v0.4.0/go.mod h1:CRYvr60xOkZOf4Atkuj+uEj2EH5pjJ39Ws3aJAkoMkA=
|
||||
github.com/hugomods/hugopress v0.4.1/go.mod h1:CRYvr60xOkZOf4Atkuj+uEj2EH5pjJ39Ws3aJAkoMkA=
|
||||
github.com/hugomods/hugopress v0.5.0/go.mod h1:CRYvr60xOkZOf4Atkuj+uEj2EH5pjJ39Ws3aJAkoMkA=
|
||||
github.com/hugomods/icons/vendors/bootstrap v0.5.6 h1:4Vj7u52gFUnO+Jj/CqmGfsLroify2aysRpIvgHRNjjI=
|
||||
github.com/hugomods/icons/vendors/bootstrap v0.5.6/go.mod h1:Sw1RhQvFcsQlJ5a4SKpp7A0XHDYQ0DK0pQwnnx+l+Ao=
|
||||
github.com/hugomods/icons/vendors/bootstrap v0.5.7/go.mod h1:bTxiIPJ/idHEc35EtvtwSODLpjI+R54BkGdikO3gCmY=
|
||||
|
|
Loading…
Reference in a new issue