diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml new file mode 100644 index 0000000..3c5a8d8 --- /dev/null +++ b/.gitea/workflows/deploy.yaml @@ -0,0 +1,34 @@ +name: Deploy +run-name: deploy frontned to remote server +on: [push] + +jobs: + copy: + runs-on: ubuntu-latest + steps: + - name: Configure SSH + run: | + mkdir -p ~/.ssh/ + echo "$SSH_KEY" > ~/.ssh/remote.key + chmod 600 ~/.ssh/remote.key + cat >>~/.ssh/config < { diff --git a/index.mjs b/index.mjs index 8157aea..3e0f97c 100644 --- a/index.mjs +++ b/index.mjs @@ -6,7 +6,7 @@ const IMAGE_COUNT = 5; initImages(IMAGE_COUNT).then(() => { console.log('Downloaded initial images successfully'); createVideo().then(() => { - console.log('Generated final images successfully'); + console.log('Generated video successfully'); }); }); @@ -14,5 +14,8 @@ initImages(IMAGE_COUNT).then(() => { setInterval(() => { updateImages(IMAGE_COUNT).then(() => { console.log('Updated images successfully'); + createVideo().then(() => { + console.log('Regenerated video successfully'); + }); }); }, 5 * 60 * 1000); diff --git a/video.mjs b/video.mjs index d7b8fa5..7a0a49c 100644 --- a/video.mjs +++ b/video.mjs @@ -39,7 +39,7 @@ export async function createVideo() { await generateFinalImages(); //run the command ffmpeg -framerate 5 -i %d.png -c:v libx264 -r 30 output.mp4 return new Promise((resolve, reject) => { - exec('ffmpeg -framerate 5 -i images/final/%d.png -c:v libx264 -r 30 images/output.mp4', (err, stdout, stderr) => { + exec('ffmpeg -framerate 5 -i images/final/%d.png -c:v libx264 -r 30 out/output.mp4', (err, stdout, stderr) => { if (err) { reject(err); return;