diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b731b7d..e34030c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -28,7 +28,7 @@ jobs: external_repository: harshavmb/harshavmb.github.io publish_dir: ./public ## not excluding anything, let .github be there - exclude_assets: '.github' + exclude_assets: '' user_name: harshavmb user_email: harshavmb@gmail.com publish_branch: main diff --git a/workflow-cd.yml b/workflow-cd.yml index 5c0a001..00c4ef0 100644 --- a/workflow-cd.yml +++ b/workflow-cd.yml @@ -2,7 +2,19 @@ name: CD for harshanu website on: push jobs: deploy: - runs-on: self-hosted + runs-on: ubuntu-latest steps: - - name: Git checkout + - name: Checkout repository uses: actions/checkout@v2 + + - name: Set up SSH key + run: | + env + mkdir -p ~/.ssh + echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa + chmod 600 ~/.ssh/id_rsa + ssh-keyscan -p 23 -t rsa ${{ vars.HETZNER_STORAGE_HOST }} >> ~/.ssh/known_hosts + + - name: Deploy code to storage box + run: | + rsync -azP --exclude=bin -e "ssh -i $HOME/.ssh/id_rsa -p 23" $(pwd)/${{ env.GITHUB_REPOSITORY }}/* ${{ vars.HETZNER_STORAGE_USER }}@${{ vars.HETZNER_STORAGE_HOST }}:${{ vars.REMOTE_WEBSITE_PATH }} \ No newline at end of file