Skip to content

Commit

Permalink
workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
12944qwerty committed May 24, 2024
1 parent 7fa3e38 commit 79b51c8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 14 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
23 changes: 18 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
types:
- completed
branches:
- main
- master

jobs:
release:
Expand All @@ -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
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'
7 changes: 1 addition & 6 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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/

0 comments on commit 79b51c8

Please sign in to comment.