[deploy] Add commit catpure to deploy step
This commit is contained in:
@ -70,14 +70,35 @@ jobs:
|
||||
-d "❌ Build failed: ${{ gitea.repository }} @ ${{ gitea.sha }}" \
|
||||
https://ntfy.unbl.ink/drone
|
||||
|
||||
deploy:
|
||||
build-and-deploy:
|
||||
# Only deploy on tags (equivalent to Drone when: ref: refs/tags/*)
|
||||
# if: startsWith(gitea.ref, 'refs/tags/')
|
||||
needs: [test]
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Deploy via SSH
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.11"
|
||||
|
||||
- name: Install Poetry
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install poetry
|
||||
|
||||
- name: Write commit hash
|
||||
run: |
|
||||
echo "commit = '${{ gitea.sha }}'" > vrobbler/_commit.py
|
||||
|
||||
- name: Build package
|
||||
run: |
|
||||
poetry build
|
||||
|
||||
- name: Copy wheel to server and deploy
|
||||
uses: appleboy/ssh-action@v1.0.3
|
||||
with:
|
||||
host: vrobbler.service
|
||||
@ -85,6 +106,11 @@ jobs:
|
||||
key: ${{ secrets.JAIL_KEY }}
|
||||
command_timeout: 2m
|
||||
script: |
|
||||
TMP_DIR=$(mktemp -d)
|
||||
# The wheel file needs to be copied first - we'll use scp outside this
|
||||
# For now, let's write the commit hash to a file on the server
|
||||
mkdir -p /var/lib/vrobbler
|
||||
echo "${{ gitea.sha }}" > /var/lib/vrobbler/commit.txt
|
||||
pip uninstall -y vrobbler
|
||||
pip install git+https://code.lab.unbl.ink/secstate/vrobbler.git@main
|
||||
vrobbler migrate
|
||||
|
||||
Reference in New Issue
Block a user