diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml index 772733b..4d8a2bc 100644 --- a/.forgejo/workflows/build.yml +++ b/.forgejo/workflows/build.yml @@ -30,15 +30,24 @@ jobs: rm -rf themes/dot-hugo make all - - uses: https://code.forgejo.org/forgejo/upload-artifact@v4 - id: artifact-upload-step - with: - name: site - path: | - public/ - if-no-files-found: error - retention-days: 10 - - - name: Show artifact URL + - name: Fake DNS name for development # TODO: remove this step after switching DNS records run: | - echo 'Download URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts/${{ steps.artifact-upload-step.outputs.artifact-id }}' + echo '185.73.212.7 frostfs.info' >> /etc/hosts + + - name: Setup SSH environment + # TODO: add deploy conditions + env: + SSH_AUTH_SOCK: /tmp/ssh_agent.socket + run: | + umask 0077 + mkdir -p ~/.ssh/ + ssh-keyscan frostfs.info >> ~/.ssh/known_hosts + ssh-agent -a "$SSH_AUTH_SOCK" + echo "${{ secrets.SSH_DEPLOY_KEY }}" > ~/.ssh/key + ssh-add ~/.ssh/key + rm ~/.ssh/key + + - run: make deploy + # TODO: add deploy conditions + env: + SSH_AUTH_SOCK: /tmp/ssh_agent.socket diff --git a/Makefile b/Makefile index 39709a7..eb70542 100644 --- a/Makefile +++ b/Makefile @@ -27,3 +27,8 @@ server: submodules $(HUGO_BIN) submodules: @git submodule init @git submodule update --recursive --remote + +.PHONY: deploy +deploy: + test -f public/index.html + cd public && tar --zstd --create . | ssh deploy@frostfs.info frostfs.info