-
Notifications
You must be signed in to change notification settings - Fork 36
49 lines (47 loc) · 1.69 KB
/
build_dev_image.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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@11bd71901bbe5b1630ceea73d27597364c9af683 # 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@11bd71901bbe5b1630ceea73d27597364c9af683 # 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