chore: set up auto deploy from sr.ht to netlify

This commit is contained in:
Ayo Ayco 2025-01-09 19:57:10 +01:00
parent a26a0d8635
commit 8d41b411ae
6 changed files with 6480 additions and 79 deletions

24
.build.yml Normal file
View file

@ -0,0 +1,24 @@
image: archlinux
packages:
- nodejs
secrets:
- 46f739e5-4538-45dd-a79f-bf173b7a2ed9
environment:
NETLIFY_SITE_ID: 390b392a-a898-491b-8500-79aa30f724d6
tasks:
- setup: |
cd mcfly/site
corepack enable
pnpm i
- build: |
cd mcfly/site
NODE_ENV=production npm run build
- deploy: |
cd mcfly/site
{
set +x
. ~/.buildsecrets
set -x
}
export NETLIFY_AUTH_TOKEN
npm run deploy

View file

@ -1,40 +0,0 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# ESLint is a tool for identifying and reporting on patterns
# found in ECMAScript/JavaScript code.
# More details at https://github.com/eslint/eslint
# and https://eslint.org
name: ESLint
on:
push:
branches: [ "main", "master" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "main" ]
schedule:
- cron: '27 4 * * 2'
jobs:
eslint:
name: Run eslint scanning
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install ESLint
run: |
npm install eslint@9.17.0
- name: Run ESLint
run: npx eslint .
--config eslint.config.mjs
continue-on-error: false

View file

@ -1,29 +0,0 @@
name: Test
on:
push:
branches: ['main']
pull_request:
# The branches below must be a subset of the branches above
branches: ['main']
schedule:
- cron: '36 3 * * 2'
jobs:
test:
name: Run test
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install core deps
run: cd packages/core && npm install --ignore-scripts
- name: Run CLI tests
run: npx vitest run .
continue-on-error: false

View file

@ -26,6 +26,7 @@
"eslint-plugin-prettier": "^5.2.1", "eslint-plugin-prettier": "^5.2.1",
"globals": "^15.14.0", "globals": "^15.14.0",
"husky": "^9.1.7", "husky": "^9.1.7",
"netlify-cli": "^18.0.0",
"prettier": "^3.4.2", "prettier": "^3.4.2",
"vitest": "^2.1.8" "vitest": "^2.1.8"
}, },

File diff suppressed because it is too large Load diff

View file

@ -21,7 +21,8 @@
"dev": "mcfly serve", "dev": "mcfly serve",
"build": "mcfly build", "build": "mcfly build",
"preview": "node .output/server/index.mjs", "preview": "node .output/server/index.mjs",
"build:preview": "pnpm run build && pnpm run preview" "build:preview": "pnpm run build && pnpm run preview",
"deploy": "netlify deploy --site=$NETLIFY_SITE_ID --dir=dist --prod"
}, },
"dependencies": { "dependencies": {
"@mcflyjs/config": "workspace:*", "@mcflyjs/config": "workspace:*",