[#25] Deploy the site via SSH

Signed-off-by: Vitaliy Potyarkin <v.potyarkin@yadro.com>
This commit is contained in:
Vitaliy Potyarkin 2024-08-29 12:59:14 +03:00
parent 6190e5a098
commit 576d108b3b
2 changed files with 27 additions and 11 deletions

View file

@ -30,15 +30,26 @@ jobs:
rm -rf themes/dot-hugo rm -rf themes/dot-hugo
make all make all
- uses: https://code.forgejo.org/forgejo/upload-artifact@v4 - name: Setup SSH environment
id: artifact-upload-step if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
with: env:
name: site SSH_AUTH_SOCK: /tmp/ssh_agent.socket
path: |
public/
if-no-files-found: error
retention-days: 10
- name: Show artifact URL
run: | run: |
echo 'Download URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts/${{ steps.artifact-upload-step.outputs.artifact-id }}' umask 0077
mkdir -p ~/.ssh/
ssh-keyscan frostfs.info >> ~/.ssh/known_hosts
ssh-keygen -A # create host keys
ssh-agent -a "$SSH_AUTH_SOCK"
echo "${{ secrets.SSH_DEPLOY_KEY }}" > ~/.ssh/key
stat ~/.ssh/key
ssh-keygen -y -f ~/.ssh/key
ssh-add ~/.ssh/key
rm ~/.ssh/key
- name: make deploy
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
run: |
ssh-add -L
make deploy
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.socket

View file

@ -27,3 +27,8 @@ server: submodules $(HUGO_BIN)
submodules: submodules:
@git submodule init @git submodule init
@git submodule update --recursive --remote @git submodule update --recursive --remote
.PHONY: deploy
deploy:
test -f public/index.html
cd public && tar --gzip --create . | ssh deploy@frostfs.info frostfs.info