From 79b51c84e60ecbf1db3e202be3bca77b2548a93e Mon Sep 17 00:00:00 2001 From: 12944qwerty Date: Fri, 24 May 2024 03:50:13 -0500 Subject: [PATCH] workflows --- .github/workflows/build.yml | 6 +++--- .github/workflows/release.yml | 23 ++++++++++++++++++----- scripts/build.sh | 7 +------ 3 files changed, 22 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 504dfb48..3a8090f6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,11 +24,11 @@ jobs: - name: Install Requirements run: python3 -m pip install --upgrade pip && pip3 install -r requirements.txt - - name: Build & Upload Artifact + - name: Build Artifact run: ./scripts/build.sh - name: Upload Artifact uses: actions/upload-artifact@v4 with: - name: pros-website.tar.gz - path: pros-website.tar.gz + name: pros-docs + path: ./build \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 93f410b6..a632c78c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,7 +6,7 @@ on: types: - completed branches: - - main + - master jobs: release: @@ -18,14 +18,27 @@ jobs: - name: Download Artifact uses: actions/download-artifact@v4 with: - name: pros-website.tar.gz - path: pros-website.tar.gz + # name: pros-docs.tar.gz + github-token: ${{ secrets.GITHUB_TOKEN }} + run-id: ${{ github.event.workflow_run.id }} + + - name: Compress Artifact + run: | + cd pros-docs + tar -czf ../pros-docs.tar.gz * + cd .. - name: Send Artifact to Server uses: betanzos/scp-upload@v1 with: - source: pros-website.tar.gz + source: pros-docs.tar.gz host: ${{ vars.SSH_HOST }} username: ${{ vars.SSH_USER }} key: ${{ secrets.SSH_KEY }} - remote_dir: ~/pros-website \ No newline at end of file + remote_dir: ~/pros-website + + - name: Deploy! + run: | + echo "${{ secrets.SSH_KEY }}" > key + chmod 400 key + ssh -o StrictHostKeyChecking=no -i key ${{ vars.SSH_USER }}@${{ vars.SSH_HOST }} '~/pros-website/deploy.sh' \ No newline at end of file diff --git a/scripts/build.sh b/scripts/build.sh index d53ea145..d4754acf 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -4,9 +4,4 @@ echo Building project make clean all rm -r ./build/v5/pros-4 mkdir ./build/v5/pros-4 -cp -r pros-doxygen-docs/* ./build/v5/pros-4/ - -mkdir artifacts -pushd build -tar -zcf ../artifacts/pros-docs.tar.gz * -popd +cp -r pros-doxygen-docs/* ./build/v5/pros-4/ \ No newline at end of file