Skip to content

Build Unstable Image #735

Build Unstable Image

Build Unstable Image #735

name: Build Unstable Image
on:
schedule:
- cron: 0 2 * * *
workflow_dispatch:
jobs:
check_date:
runs-on: ubuntu-latest
name: Check latest commit
outputs:
should_run: ${{ steps.should_run.outputs.should_run }}
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4
- name: print latest_commit
run: echo ${{ github.sha }}
- id: should_run
continue-on-error: true
name: check latest commit is less than a day
if: ${{ github.event_name == 'schedule' }}
run: test -z $(git rev-list --after="24 hours" ${{ github.sha }}) && echo "::set-output name=should_run::false"
audioserve-build:
runs-on: ubuntu-22.04
needs: check_date
if: ${{ needs.check_date.outputs.should_run != 'false' }}
steps:
- name: Check docker
run: |
echo "Starting build"
docker --version
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4
- name: Build image
run: docker build --tag izderadicka/audioserve:unstable --build-arg CARGO_ARGS="--features=transcoding-cache,collation" .
- name: Publish image
run: |
docker login -u ${{secrets.DOCKERHUB_USER}} -p ${{secrets.DOCKERHUB_PASSWORD}}
docker push izderadicka/audioserve:unstable
- name: ssh to VM and redeploy
uses: appleboy/ssh-action@master
with:
host: audioserve.zderadicka.eu
username: ${{ secrets.AUDIOSERVE_USERNAME }}
key: ${{ secrets.AUDIOSERVE_KEY }}
script: |
docker stop -t 30 audioserve || true
docker rm -f audioserve || true
docker pull izderadicka/audioserve:unstable
./run-audioserve.sh