Compare commits

...

5 Commits

Author SHA1 Message Date
jolheiser 95cd195032
Update '.woodpecker.yml'
ci/woodpecker/push/woodpecker Pipeline was successful Details
ci/woodpecker/tag/woodpecker Pipeline was successful Details
2022-01-11 03:22:52 +00:00
Joey Hines 9e79ef83cb
Updated server HW specs (#2) (#5)
ci/woodpecker/push/woodpecker Pipeline failed Details
Resolves #2

+ Updated server specs
+ Pointed link to the new OVH HW page

Co-authored-by: jolheiser <john.olheiser@gmail.com>
Reviewed-on: #5
Co-authored-by: Joey Hines <joey@ahines.net>
Co-committed-by: Joey Hines <joey@ahines.net>
2022-01-11 02:59:53 +00:00
Joey Hines 4fd7ba19cb
Removed refs to BirbMC (#3) (#4)
Resolves #3

+ Updated footer on MD pages
+ Renamed \_birbmc.scss to \_canopymc.scss
+ Pointed update script at jojodev

Reviewed-on: #4
Co-authored-by: Joey Hines <joey@ahines.net>
Co-committed-by: Joey Hines <joey@ahines.net>
2022-01-11 02:58:02 +00:00
jolheiser bbeccf95ad
Add netlify process (#1)
continuous-integration/woodpecker the build failed Details
Reviewed-on: Canopy/website#1
Co-authored-by: jolheiser <john.olheiser@gmail.com>
Co-committed-by: jolheiser <john.olheiser@gmail.com>
2021-12-11 17:28:40 +00:00
jolheiser 49129bb471
Move to woodpecker
continuous-integration/woodpecker the build failed Details
Signed-off-by: jolheiser <john.olheiser@gmail.com>
2021-12-09 23:10:03 -06:00
12 changed files with 42249 additions and 58 deletions

View File

@ -1,44 +0,0 @@
---
kind: pipeline
name: compliance
trigger:
event:
- pull_request
steps:
- name: build
pull: always
image: node:14
commands:
- npm install
- npm run build
---
kind: pipeline
name: release
trigger:
event:
- push
branch:
- main
steps:
- name: build
pull: always
image: node:14
commands:
- npm install
- npm run build
- name: archive
pull: always
image: jolheiser/drone-arc:latest
settings:
files:
- "dist/*"
output: dist.tar.gz
- name: gitea-release
pull: always
image: jolheiser/drone-gitea-main:latest
settings:
token:
from_secret: gitea_token
base: https://git.birbmc.com
files:
- "dist.tar.gz"

4
.gitignore vendored
View File

@ -9,4 +9,6 @@ src/assets/webfonts/fa*
dist/ dist/
# Node # Node
node_modules/ node_modules/
# Local Netlify folder
.netlify

42
.woodpecker.yml 100644
View File

@ -0,0 +1,42 @@
clone:
git:
image: woodpeckerci/plugin-git:next
pipeline:
compliance:
image: node:14
commands:
- npm install
- npm run build
when:
event: [pull_request]
netlify:
image: node:14
secrets:
- bot_token
- netlify_site_id
- netlify_auth_token
commands:
- node netlify.js
when:
event: [pull_request]
archive:
image: jolheiser/drone-arc:latest
when:
event: push
branch: main
settings:
files:
- "dist/*"
output: dist.tar.gz
release:
image: jolheiser/drone-gitea-main:latest
when:
event: push
branch: main
settings:
token:
from_secret: gitea_token
base: https://git.jojodev.com
files:
- "dist.tar.gz"

View File

@ -5,7 +5,7 @@ rm -rf dist_bk/
cp -r dist/ dist_bk/ cp -r dist/ dist_bk/
# Get new dist # Get new dist
wget https://git.birbmc.com/BirbMC/birbmc.com/releases/download/latest/dist.tar.gz wget https://git.jojodev.com/Minecraft/website/releases/download/latest/dist.tar.gz
# Replace existing dist with new dist # Replace existing dist with new dist
rm -rf dist/ rm -rf dist/

71
netlify.js 100644
View File

@ -0,0 +1,71 @@
const slugify = require('slugify')
const {exec} = require('child_process')
const axios = require('axios')
const siteId = process.env.NETLIFY_SITE_ID
const branchSlug = slugify(process.env.DRONE_SOURCE_BRANCH)
const prNumber = process.env.CI_PULL_REQUEST
const alias = `${prNumber}-${branchSlug}`
const promiseExec = cmd => {
return new Promise((resolve, reject) => {
exec(cmd, (error, stdout, stderr) => {
if (error) {
reject(error)
return
}
resolve(stdout)
})
})
}
(async function () {
let stdout = await promiseExec(`./node_modules/.bin/netlify link --id ${siteId}`)
console.log(stdout)
stdout = await promiseExec(`./node_modules/.bin/netlify deploy --alias ${alias}`)
console.log(stdout)
})()
// We need the user id of the bot to prevent multiple comments as the PR gets updated
const BOT_USER_ID = 8
// The gitea token from the pipeline settings
const giteaToken = process.env.BOT_TOKEN
// The second, hard coded part of this url is something you need to set in Netlify's site settings.
const fullPreviewUrl = `https://${alias}--canopymc.netlify.app`
const prIssueCommentsUrl = `https://git.jojodev.com/api/v1/repos/Canopy/website/issues/${prNumber}/comments`;
(async function () {
// Here we get all comments through Gitea's API to see if there's already a comment from our bot
const {data} = await axios.get(prIssueCommentsUrl)
const hasComment = data.some(c => c.user.id === BOT_USER_ID)
if (hasComment) {
console.log(`PR #${prNumber} already has a comment with a link, not sending another comment.`)
return
}
// Once we arrive here we know for sure there's no other comment yet. That means we can proceed to post one.
await axios.post(prIssueCommentsUrl, {
body: `
Hi ${process.env.CI_COMMIT_AUTHOR}!
Thank you for creating a PR!
[I've deployed a preview of the changes here.](${fullPreviewUrl})
> Beep boop, I'm a bot. :robot:
`,
}, {
headers: {
'Content-Type': 'application/json',
'accept': 'application/json',
'Authorization': `token ${giteaToken}`,
},
})
console.log(`Preview comment sent successfully to PR #${prNumber}!`)
})()

11
netlify.toml 100644
View File

@ -0,0 +1,11 @@
[build]
command = "npm build"
publish = "dist"
[[headers]]
for = "/*"
[headers.values]
X-Frame-Options = "DENY"
X-XSS-Protection = "1; mode=block"
X-Robots-Tag = "noindex"

42113
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -18,12 +18,16 @@
"url": "https://git.jojodev.com/Canopy/canopymc.net.git" "url": "https://git.jojodev.com/Canopy/canopymc.net.git"
}, },
"author": "", "author": "",
"license": "IST", "license": "MIT",
"devDependencies": { "devDependencies": {
"@fortawesome/fontawesome-free": "^5.15.1", "@fortawesome/fontawesome-free": "^5.15.1",
"copyfiles": "^2.4.0", "copyfiles": "^2.4.0",
"dart-sass": "^1.25.0", "dart-sass": "^1.25.0",
"front-matter": "^4.0.2", "front-matter": "^4.0.2",
"showdown": "^1.9.1" "showdown": "^1.9.1",
"slugify": "^1.6.3",
"axios": "^0.24.0",
"netlify": "^10.0.0",
"netlify-cli": "^8.0.19"
} }
} }

View File

@ -95,5 +95,5 @@ $fa-font-path: "../webfonts";
@import "layout/footer"; @import "layout/footer";
@import "layout/wrapper"; @import "layout/wrapper";
// BirbMC // CanopyMC
@import "birbmc"; @import "canopymc";

View File

@ -106,9 +106,9 @@
<span class="icon solid major style4 fa-server"></span> <span class="icon solid major style4 fa-server"></span>
<h3>Dedicated Server</h3> <h3>Dedicated Server</h3>
<p> <p>
Intel i7-7700K (4c/8t at 4.2+GHz) with 64GB of RAM and dual Intel Xeon-E 2386G - 6c/ 12 t - 3.5GHz / 4.7GHz with 64 GB of RAM
450GB NVMe SSDs in RAID - full specification 950GB NVMe SSDs in RAID - full specification
<a href="https://www.ovhcloud.com/en/bare-metal/rise/rise-2/" <a href="https://us.ovhcloud.com/bare-metal/advance/adv-1/"
>here.</a >here.</a
> >
</p> </p>

View File

@ -36,7 +36,7 @@
<!-- Footer --> <!-- Footer -->
<footer id="footer"> <footer id="footer">
<p class="copyright"> <p class="copyright">
&copy; BirbMC. Design: <a href="https://html5up.net">HTML5 UP</a>. &copy; CanopyMC. Design: <a href="https://html5up.net">HTML5 UP</a>.
</p> </p>
</footer> </footer>
</div> </div>