appease CI/ webpack

move to ci/
change triggers
This commit is contained in:
Michael C 2021-11-30 16:44:42 -05:00
parent e4e453a11c
commit dc47b9ffd2
No known key found for this signature in database
GPG key ID: FFB04FB3B878B7B4
6 changed files with 42 additions and 5 deletions

32
.github/workflows/updateInvidous.yml vendored Normal file
View file

@ -0,0 +1,32 @@
name: update invidious
on:
workflow_dispatch:
schedule:
- cron: '0 0 1 * *' # check every month
jobs:
check-list:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Download instance list
run: |
wget https://api.invidious.io/instances.json -O data.json
- name: "Run CI"
run: npm run ci:invidious
- name: setup git config
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: "Commit new files"
run : |
if [ $(git status --porcelain=v1 2>/dev/null | wc -l) -ge 1 ]
then
echo "pushing changes"
git add invidiouslist.json
git commit -m "[CI] New Invidious List"
git push origin main
else
echo "no changes"
fi

2
.gitignore vendored
View file

@ -7,4 +7,4 @@ web-ext-artifacts
dist/
tmp/
.DS_Store
src/ci/data.json
ci/data.json

View file

@ -4,10 +4,15 @@ This file is only ran by GitHub Actions in order to populate the Invidious insta
This file should not be shipped with the extension
*/
import { writeFile } from 'fs';
import { writeFile, existsSync } from 'fs';
import { join } from 'path';
// import file downloade from https://api.invidious.io/instances.json
// import file from https://api.invidious.io/instances.json
if (!existsSync('./data.json')) {
process.exit(1);
}
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
import * as data from "./data.json";
type instanceMap = {

View file

@ -52,7 +52,7 @@
"build:watch": "npm run build:watch:chrome",
"build:watch:chrome": "webpack --env.browser=chrome --config webpack/webpack.dev.js --watch",
"build:watch:firefox": "webpack --env.browser=firefox --config webpack/webpack.dev.js --watch",
"ci:invidious": "ts-node src/ci/invidiousCI.ts",
"ci:invidious": "ts-node ci/invidiousCI.ts",
"dev": "npm run build:dev && concurrently \"npm run web-run\" \"npm run build:watch\"",
"dev:firefox": "npm run build:dev:firefox && concurrently \"npm run web-run:firefox\" \"npm run build:watch:firefox\"",
"dev:firefox-android": "npm run build:dev:firefox && concurrently \"npm run web-run:firefox-android\" \"npm run build:watch:firefox\"",

View file

@ -1,5 +1,5 @@
import * as CompileConfig from "../config.json";
import * as invidiousList from "../src/ci/invidiouslist.json";
import * as invidiousList from "../ci/invidiouslist.json";
import { Category, CategorySelection, CategorySkipOption, NoticeVisbilityMode, PreviewBarOption, SponsorTime, StorageChangesObject, UnEncodedSegmentTimes as UnencodedSegmentTimes } from "./types";
interface SBConfig {