🔖 Release v0.2.4 #40
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy Website | |
on: | |
push: | |
branches: ['main'] | |
pull_request: | |
branches: ['main'] | |
jobs: | |
version: | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.get_version.outputs.version }} | |
version_changed: ${{ steps.check_version.outputs.version_changed }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Check for version change | |
id: check_version | |
run: | | |
if git diff --name-only HEAD~1..HEAD | grep -q '^website/package\.json$'; then | |
VERSION_CHANGED=1 | |
else | |
VERSION_CHANGED=0 | |
fi | |
echo "version_changed=$VERSION_CHANGED" >> "$GITHUB_OUTPUT" | |
- name: Get version | |
if: ${{ steps.check_version.outputs.version_changed == '1' }} | |
id: get_version | |
run: | | |
VERSION=$(jq -r .version website/package.json) | |
echo "version=$VERSION" >> "$GITHUB_OUTPUT" | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy website | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.VPS_HOST }} | |
username: ${{ secrets.VPS_USERNAME }} | |
password: ${{ secrets.VPS_PASSWORD }} | |
port: ${{ secrets.VPS_PORT }} | |
script: | | |
cd react-dot-cursor/ | |
git pull | |
docker compose up -d --build |