maybe working #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy to Poisson | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Write SSH keys | |
run: | | |
install -m 600 -D /dev/null ~/.ssh/known_hosts | |
install -m 600 -D /dev/null ~/.ssh/id_ed25519_github | |
install -m 600 -D /dev/null ~/.ssh/id_ed25519_github.pub | |
echo "${{ secrets.SSH_KNOWN_HOSTS }}" > ~/.ssh/known_hosts | |
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519_github | |
echo "${{ secrets.SSH_PUBLIC_KEY }}" > ~/.ssh/id_ed25519_github.pub | |
- name: Setup Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '23' | |
- name: Cache node modules | |
id: cache-npm | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-node-modules | |
with: | |
# npm cache files are stored in `~/.npm` on Linux/macOS | |
path: ~/.npm | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }} | |
name: List the state of node modules | |
continue-on-error: true | |
run: npm list | |
- name: Install dependencies | |
run: npm install | |
- name: Build | |
run: npm run build:poisson | |
- name: Deploy | |
run: rsync -e 'ssh -i ~/.ssh/id_ed25519_github' -avz out/ delucreziis@poisson.phc.dm.unipi.it:public_html/ |