Updated packages and config and fixed the CI/CD pipeline (I hope)
This commit is contained in:
parent
3dbd4d3b0a
commit
b04d9de788
5 changed files with 2377 additions and 1641 deletions
|
|
@ -19,7 +19,7 @@ jobs:
|
|||
- name: Setup Nodejs
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
cache: "pnpm"
|
||||
node-version: 22
|
||||
|
||||
- name: "Install dependencies"
|
||||
run: pnpm install
|
||||
|
|
@ -37,21 +37,40 @@ jobs:
|
|||
needs: build
|
||||
runs-on: docker
|
||||
steps:
|
||||
- name: Get current date
|
||||
id: date
|
||||
run: echo "::set-output name=date::$(date +'%Y%m%d%H%M%S')"
|
||||
- name: Setup SSH
|
||||
- name: Install Deployment Tools
|
||||
run: |
|
||||
mkdir -p ~/.ssh
|
||||
chmod 0700 ~/.ssh
|
||||
echo "${{ secrets.SSHPRIVKEY }}" > ~/.ssh/id_ed25519
|
||||
chmod 0600 ~/.ssh/id_ed25519
|
||||
echo "[${{ vars.WEBSERVER_IP }}]:${{ SSHPORT }} ${{ secrets.SSHPUBKEY }}" > ~/.ssh/known_hosts
|
||||
chmod 0600 ~/.ssh/known_hosts
|
||||
if command -v apk >/dev/null; then
|
||||
apk add --no-cache rsync openssh-client
|
||||
else
|
||||
apt-get update && apt-get install -y rsync openssh-client
|
||||
fi
|
||||
- name: Setup SSH
|
||||
uses: https://github.com/webfactory/ssh-agent@v0.9.0
|
||||
with:
|
||||
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||
- name: Push
|
||||
run: |
|
||||
scp -P ${{ secrets.SSHPORT }} -r dist ${{ secrets.SSH_USERNAME }}@${{ vars.WEBSERVER_IP }}:~/oblog-parallels/build-${{ steps.date.outputs.date }}
|
||||
- name: Update symlink
|
||||
run: |
|
||||
ssh ${{ secrets.SSH_USERNAME }}@${{ vars.WEBSERVER_IP }} -p ${{ secrets.SSHPORT }} "cp -r ~/oblog-parallels/build-${{ steps.date.outputs.date }} ~/oblog-parallels/dist"
|
||||
rsync -avz -e "ssh -p ${{ secrets.SERVER_PORT }}" \
|
||||
--delete ./dist/ \
|
||||
${{ secrets.SERVER_USER }}@${{ secrets.SERVER_IP }}:${{ variables.DESTINATION }}
|
||||
|
||||
notify:
|
||||
needs: deploy
|
||||
runs-on: docker
|
||||
if: always() # Always run
|
||||
steps:
|
||||
- name: Send Discord Notification
|
||||
run: |
|
||||
STATUS="${{ needs.deploy.result }}"
|
||||
COLOR=$([ "$STATUS" == "success" ] && echo "4582179" || echo "16711680")
|
||||
|
||||
curl -H "Content-Type: application/json" \
|
||||
-X POST \
|
||||
-d '{
|
||||
"embeds": [{
|
||||
"title": "Deployment Report",
|
||||
"color": '$COLOR',
|
||||
"description": "Status: **'$STATUS'**\nRepo: ${{ github.repository }}\nCommit: ${{ github.sha }}"
|
||||
}]
|
||||
}' \
|
||||
"${{ secrets.DISCORD_WEBHOOK_URL }}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue