This commit is contained in:
parent
34b99513cc
commit
9290cd8771
|
@ -8,16 +8,16 @@ on:
|
|||
jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
# env:
|
||||
# SSH_PRIVATE_KEY: ${{ secrets.SOME_SECRET_THAT_REPRESENTS_THE_PRIVATE_KEY }}
|
||||
env:
|
||||
SSH_PRIVATE_KEY: ${{ secrets.SSH_DEPLOY_PRIVATE_KEY }}
|
||||
steps:
|
||||
- run: apt update && apt install dnsutils -y && dig git.ifsr.de
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
- name: checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
- name: setup node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 'lts/*'
|
||||
|
||||
|
@ -25,15 +25,18 @@ jobs:
|
|||
|
||||
- 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:
|
||||
path: _site
|
||||
|
||||
# - name: Deploy
|
||||
# run: |
|
||||
# eval $(ssh-agent -s)
|
||||
# echo "$SSH_PRIVATE_KEY" | ssh-add -
|
||||
# apt update && apt install -y rsync
|
||||
# mkdir ~/.ssh
|
||||
# ssh-keyscan your-host.com > ~/.ssh/known_hosts
|
||||
# rsync -atv --progress ./public/ your-user@your-host.com:/home/your-user/your-content-directory/public
|
||||
- name: deploy
|
||||
run: |
|
||||
apt-get update && apt-get install -y rsync
|
||||
wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq && chmod +x /usr/bin/yq
|
||||
eval $(ssh-agent -s)
|
||||
echo "$SSH_PRIVATE_KEY" | ssh-add -
|
||||
mkdir ~/.ssh
|
||||
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"
|
||||
|
|
Loading…
Reference in a new issue