auto deploy
All checks were successful
publish / publish (push) Successful in 31s

This commit is contained in:
Lyn Fugmann 2024-10-06 23:06:29 +02:00
parent 34b99513cc
commit 9290cd8771

View file

@ -8,16 +8,16 @@ on:
jobs: jobs:
publish: publish:
runs-on: ubuntu-latest runs-on: ubuntu-latest
# env: env:
# SSH_PRIVATE_KEY: ${{ secrets.SOME_SECRET_THAT_REPRESENTS_THE_PRIVATE_KEY }} SSH_PRIVATE_KEY: ${{ secrets.SSH_DEPLOY_PRIVATE_KEY }}
steps: steps:
- run: apt update && apt install dnsutils -y && dig git.ifsr.de - name: checkout
uses: actions/checkout@v4
- uses: actions/checkout@v4
with: with:
submodules: recursive submodules: recursive
- uses: actions/setup-node@v4 - name: setup node
uses: actions/setup-node@v4
with: with:
node-version: 'lts/*' node-version: 'lts/*'
@ -25,15 +25,18 @@ jobs:
- run: npm run build - run: npm run build
- uses: https://code.forgejo.org/forgejo/upload-artifact@v4 - name: upload artifact
uses: https://code.forgejo.org/forgejo/upload-artifact@v4
with: with:
path: _site path: _site
# - name: Deploy - name: deploy
# run: | run: |
# eval $(ssh-agent -s) apt-get update && apt-get install -y rsync
# echo "$SSH_PRIVATE_KEY" | ssh-add - wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq && chmod +x /usr/bin/yq
# apt update && apt install -y rsync eval $(ssh-agent -s)
# mkdir ~/.ssh echo "$SSH_PRIVATE_KEY" | ssh-add -
# ssh-keyscan your-host.com > ~/.ssh/known_hosts mkdir ~/.ssh
# rsync -atv --progress ./public/ your-user@your-host.com:/home/your-user/your-content-directory/public ssh-keyscan ifsr.de > ~/.ssh/known_hosts
year=$(yq '.year' content/_data/ese.yaml)
rsync -rvh --progress --delete --chmod=ugo=rwX _site/ ese-deploy@ifsr.de:"$year"