Compare commits
2 Commits
e35ae5d88d
...
a1794ee3a7
| Author | SHA1 | Date | |
|---|---|---|---|
| a1794ee3a7 | |||
| a1b5831e10 |
@ -3,7 +3,7 @@ name: Deploy Blog to Folder
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main # or your target branch
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
@ -13,15 +13,29 @@ jobs:
|
|||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Check commit message for "skipdeploy"
|
||||||
|
id: check_commit
|
||||||
|
run: |
|
||||||
|
COMMIT_MSG=$(git log -1 --pretty=%B)
|
||||||
|
echo "Last commit message: $COMMIT_MSG"
|
||||||
|
if [[ "$COMMIT_MSG" == skipdeploy* ]]; then
|
||||||
|
echo "Skipping deployment due to commit message."
|
||||||
|
echo "should_deploy=false" >> $GITHUB_ENV
|
||||||
|
else
|
||||||
|
echo "should_deploy=true" >> $GITHUB_ENV
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Build site
|
- name: Build site
|
||||||
|
if: env.should_deploy == 'true'
|
||||||
run: |
|
run: |
|
||||||
cd ./src
|
cd ./src
|
||||||
npx @11ty/eleventy
|
npx @11ty/eleventy
|
||||||
|
|
||||||
- name: Deploy folder
|
- name: Deploy folder
|
||||||
|
if: env.should_deploy == 'true'
|
||||||
run: |
|
run: |
|
||||||
echo "Cleaning old site files..."
|
echo "Cleaning old site files..."
|
||||||
rm -rf /var/sites/cy.cyper.cc/www/html/*
|
rm -rf /var/sites/cy.cyper.cc/www/html/*
|
||||||
|
|
||||||
echo "Deploying new site files from src/_site folder..."
|
echo "Deploying new site files from src/_site folder..."
|
||||||
mv ./src/_site/* /var/sites/cy.cyper.cc/www/html
|
mv ./src/_site/* /var/sites/cy.cyper.cc/www/html
|
||||||
|
|||||||
4
.gitignore
vendored
4
.gitignore
vendored
@ -1 +1,3 @@
|
|||||||
src/_site/
|
# @11ty/eleventy output
|
||||||
|
src/_site/
|
||||||
|
_site/
|
||||||
17
package.json
Normal file
17
package.json
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"name": "cybyside",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "My personal blog",
|
||||||
|
"scripts": {
|
||||||
|
"start": "npx @11ty/eleventy --input ./src",
|
||||||
|
"clean": "rm -rf {_site,./src/_site}"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://git.cyper.cc/Cyper/CyBySide"
|
||||||
|
},
|
||||||
|
"keywords": ["blog", "@11ty/eleventy", "eleventy"],
|
||||||
|
"author": "Cyper",
|
||||||
|
"license": "ISC",
|
||||||
|
"type": "commonjs"
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user