From 25d74d65e89e8fc52a8d27ab441a26477b86d285 Mon Sep 17 00:00:00 2001 From: Shen Shen Date: Sun, 18 Aug 2024 22:12:53 -0400 Subject: [PATCH] clean up --- .github/workflows/deployment.yml | 29 +++++------------------------ 1 file changed, 5 insertions(+), 24 deletions(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index fa7bb36..1826049 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -11,19 +11,6 @@ jobs: runs-on: ubuntu-latest steps: - # - name: Checkout Code - # uses: actions/checkout@v2 - - # - name: Set Up SSH Agent - # env: - # SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} # Ensure you have added the SSH private key as a secret - # run: | - # echo "$SSH_PRIVATE_KEY" > private_key - # chmod 600 private_key - # eval "$(ssh-agent -s)" - # ssh-add private_key - - - name: Execute Commands on Remote Server run: | mkdir -p ~/.ssh @@ -31,24 +18,18 @@ jobs: echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa chmod 600 ~/.ssh/id_rsa.pub chmod 600 ~/.ssh/id_rsa - if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then ssh -p ${{ secrets.REMOTE_PORT }} -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no ${{ secrets.REMOTE_USER }}@${{ secrets.REMOTE_HOST }} << 'EOF' + export PATH="/home/shensquared/.rbenv/bin:$PATH" + eval "$(rbenv init -)" + if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then cd /home/shensquared/gradML echo "Running on main branch" git pull origin main - export PATH="/home/shensquared/.rbenv/bin:$PATH" - eval "$(rbenv init -)" bundle exec jekyll build - EOF elif [[ "${{ github.ref }}" == "refs/heads/dev" ]]; then - ssh -p ${{ secrets.REMOTE_PORT }} -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no ${{ secrets.REMOTE_USER }}@${{ secrets.REMOTE_HOST }} << 'EOF' - cd /home/shensquared/gradML_dev # Replace with the relevant folder path + cd /home/shensquared/gradML_dev echo "Running on dev branch" git pull origin dev - export PATH="/home/shensquared/.rbenv/bin:$PATH" - eval "$(rbenv init -)" bundle exec jekyll build --config _config.yml,_config_dev.yml - EOF fi - - + EOF \ No newline at end of file