Skip to content

Commit

Permalink
Serverless rework (#89)
Browse files Browse the repository at this point in the history
* Serverless rework

* regen lock

* Fix up

* Add log to file flag

* Fix up
  • Loading branch information
inverse authored Feb 21, 2024
1 parent 640d544 commit 1adaf02
Show file tree
Hide file tree
Showing 20 changed files with 8,874 additions and 725 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,25 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
phpstan:
runs-on: ubuntu-latest
container:
image: jakzal/phpqa:php8.1
steps:
- uses: actions/checkout@v4
- name: Install PHP
uses: shivammathur/setup-php@master
with:
php-version: '8.3'
- name: Install dependencies
run: composer install
- name: PHPStan
run: phpstan analyse
run: ./vendor/bin/phpstan analyse
php-cs-fixer:
runs-on: ubuntu-latest
container:
image: jakzal/phpqa:php8.1
steps:
- uses: actions/checkout@v4
- name: Install PHP
uses: shivammathur/setup-php@master
with:
php-version: '8.3'
- name: Install dependencies
run: composer install
- name: PHP-CS-Fixer
run: php-cs-fixer fix
run: ./vendor/bin/php-cs-fixer fix
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@
/.php_cs.cache
/.php-cs-fixer.cache
/coverage.xml
/.serverless/
/node_modules/
2 changes: 2 additions & 0 deletions .mise.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[tools]
node = '20.11.1'
26 changes: 25 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,30 @@ Configure this to run on a regular schedule using something that your OS provide

_Note: Don't set the schedule frequency to high to not overload their website_

# Licence
## Run (serverless)

Termin can also be run as a serverless application. Configure the application like you would normally.

Then configure your environment with [serverless tooling][9].

```bash
npm install
```

And finally deploy:

```bash
./node_modules/.bin/serverless deploy
```

To remove run:

```bash
./node_modules/.bin/serverless remove
```


# License

MIT

Expand All @@ -210,3 +233,4 @@ MIT
[6]: https://ntfy.sh/
[7]: https://ntfy.sh/docs/subscribe/phone/
[8]: https://ntfy.sh/docs/subscribe/web/
[9]: https://bref.sh/docs/setup
8 changes: 7 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"php": ">=8.1",
"ext-curl": "*",
"ext-dom": "*",
"bref/bref": "^2.1",
"campo/random-user-agent": "^1.3",
"ivkos/pushbullet": "^3.3",
"monolog/monolog": "^2.1.1",
Expand All @@ -25,6 +26,8 @@
}
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.49",
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^10.4"
},
"autoload-dev": {
Expand All @@ -33,6 +36,9 @@
}
},
"config": {
"sort-packages": true
"sort-packages": true,
"platform": {
"php": "8.1.27"
}
}
}
Loading

0 comments on commit 1adaf02

Please sign in to comment.