[ci] Add test action and fix deploy
This commit is contained in:
56
.gitea/workflows/ci.yml
Normal file
56
.gitea/workflows/ci.yml
Normal file
@ -0,0 +1,56 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Lint
|
||||
run: npm run lint
|
||||
|
||||
- name: Test
|
||||
run: npm test
|
||||
|
||||
deploy:
|
||||
if: github.ref == 'refs/heads/main'
|
||||
runs-on: ubuntu-latest
|
||||
needs: test
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Build assets
|
||||
run: npm run build
|
||||
|
||||
# TODO: Add your deploy step here, for example:
|
||||
# - name: Build and push Docker image
|
||||
# run: |
|
||||
# docker build -t iris .
|
||||
# docker push your-registry/iris:latest
|
||||
#
|
||||
# Or scp to a server:
|
||||
# - name: Deploy via rsync
|
||||
# run: |
|
||||
# rsync -avz --delete mopidy_iris/ user@server:/path/to/deploy
|
||||
@ -14,6 +14,6 @@ jobs:
|
||||
username: root
|
||||
key: ${{ secrets.JAIL_KEY }}
|
||||
script: |
|
||||
pip uninstall -y Iris
|
||||
pip uninstall -y mopidy-iris
|
||||
pip install git+https://code.lab.unbl.ink/secstate/Iris@main
|
||||
service mopidy restart
|
||||
|
||||
Reference in New Issue
Block a user