From 4ca2ddfac39066ebd866c6491762a1c1c249d970 Mon Sep 17 00:00:00 2001 From: Emilia Date: Wed, 6 Jul 2022 13:30:28 -0400 Subject: [PATCH 1/3] Create deploy It'll probably take a few attempts to get this to work --- .github/workflows/deploy | 63 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 .github/workflows/deploy diff --git a/.github/workflows/deploy b/.github/workflows/deploy new file mode 100644 index 0000000..b0b180d --- /dev/null +++ b/.github/workflows/deploy @@ -0,0 +1,63 @@ +name: CI +on: + push: + branches: [master] + workflow_dispatch: +jobs: + pull: + runs-on: ubuntu-latest + steps: + - name: Pull most recent version of repo + uses: appleboy/ssh-action@master + with: + host: ilia.moe + user: ubuntu + key: ${{ secrets.SSH_KEY }} + script: | + cd repo + git pull --force origin master + + build-sass: + runs-on: ubuntu-latest + needs: pull + steps: + - name: Recompile sass for the main website + uses: appleboy/ssh-action@master + with: + host: ilia.moe + user: ubuntu + key: ${{ secrets.SSH_KEY }} + script: | + cd repo/src + sass sass/:css/ + build-hugo: + runs-on: ubuntu-latest + needs: pull + steps: + - name: Build hugo + uses: appleboy/ssh-action@master + with: + host: ilia.moe + user: ubuntu + key: ${{ secrets.SSH_KEY }} + script: | + cd repo/hugo + cd recipe + hugo -D + move-files: + runs-on: ubuntu-latest + needs: [build-sass, build-hugo] + steps: + - name: Move files so NGINX can see them + uses: appleboy/ssh-action@master + with: + host: ilia.moe + user: ubuntu + key: ${{ secrets.SSH_KEY }} + script: | + sudo su + cp -r repo/src /usr/share/nginx/html/ilia.moe + cp -r repo/hugo/recipe/public /usr/share/nginx/html/ilia.moe/cool-stuff/ + + + From 33b635c35553c06a70437660c09bfb347ab636e1 Mon Sep 17 00:00:00 2001 From: Emilia Date: Wed, 6 Jul 2022 13:40:30 -0400 Subject: [PATCH 2/3] Rename deploy to deploy.yaml first in a likely very long string of commits --- .github/workflows/{deploy => deploy.yaml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{deploy => deploy.yaml} (100%) diff --git a/.github/workflows/deploy b/.github/workflows/deploy.yaml similarity index 100% rename from .github/workflows/deploy rename to .github/workflows/deploy.yaml From 92e306978e691adabc6a80095f85738979f5607d Mon Sep 17 00:00:00 2001 From: Emilia Date: Wed, 6 Jul 2022 13:41:43 -0400 Subject: [PATCH 3/3] Update deploy.yaml user -> username --- .github/workflows/deploy.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index b0b180d..853691c 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -11,7 +11,7 @@ jobs: uses: appleboy/ssh-action@master with: host: ilia.moe - user: ubuntu + username: ubuntu key: ${{ secrets.SSH_KEY }} script: | cd repo @@ -25,7 +25,7 @@ jobs: uses: appleboy/ssh-action@master with: host: ilia.moe - user: ubuntu + username: ubuntu key: ${{ secrets.SSH_KEY }} script: | cd repo/src @@ -38,7 +38,7 @@ jobs: uses: appleboy/ssh-action@master with: host: ilia.moe - user: ubuntu + username: ubuntu key: ${{ secrets.SSH_KEY }} script: | cd repo/hugo @@ -52,7 +52,7 @@ jobs: uses: appleboy/ssh-action@master with: host: ilia.moe - user: ubuntu + username: ubuntu key: ${{ secrets.SSH_KEY }} script: | sudo su