Steps to deploy Node.js to VPS using PM2 and Github Actions
| # Updated from SvelteKit docs. See https://kit.svelte.dev/docs/adapter-static#github-pages for more information | |
| name: Deploy to GitHub Pages | |
| on: | |
| push: | |
| branches: 'main' | |
| jobs: | |
| build_site: |
| { | |
| supervisor { | |
| php-fpm | |
| } | |
| } | |
| :8080 | |
| php_fastcgi 127.0.0.1:9000 | |
| root * . |
| # http service configuration. | |
| http: | |
| # http host to listen. | |
| address: 0.0.0.0:8080 | |
| # http worker pool configuration. | |
| workers: | |
| # php worker command - point to the entry point | |
| command: "php public/index.php" | |
| # worker pool configuration(for dev env) | |
| pool: |
| $Devs = (Get-NetAdapter | Where-Object -Property Name -Like vEthernet* | Where-Object -Property Status -Like "Not Present" ) | |
| ForEach ($Dev in $Devs) { | |
| $RemoveKey = "HKLM:\SYSTEM\Setup\Upgrade\NetworkDriverBackup\Control\Network\{4d36e972-e325-11ce-bfc1-08002be10318}\$($Dev.InstanceId)" | |
| Remove-Item -Path $RemoveKey | |
| } |
Assuming you don't want to statically export a Sapper app, most of the parts to build a simple SSG for Svelte already exist. The only thing that is missing is the tooling ('only').
However, you don't need a lot to get things going: just a couple of rollup builds and a config file will get you most of the way there. Just some glue.
What follows is a bunch of rambling, half thought out thoughts on how I would probably go about this. Most of the stuff discussed here is stuff I've actually done or half done or am in the process of doing with varying degrees of success. It is something I'll be spending more time on in the future. There are other things I have done, want to do, or think would be a good idea that are not listed here as they don't fall into the scope of a simple SSG.
*Dislaimer: This is how I would build an SSG, this isn't the only way, but I like this approach as there are a bunch of compile-time optimisations you can per
| worker_processes 1; | |
| events { | |
| worker_connections 1024; | |
| } | |
| http { | |
| include mime.types; | |
| default_type application/octet-stream; |
This is a docker-compose template for a lemp stack.
Make sure to change both the root password under the mysql service, and the absolute URI on the phpmyadmin container.
You can also expose phpMyAdmin locally instead of remotely by properly configuring the ports.
Default locations:
(Original) -> (Your server)
/var/www/html -> ./webroot
/etc/nginx -> ./nginx
