-
Notifications
You must be signed in to change notification settings - Fork 70
184 lines (158 loc) · 5.9 KB
/
build-video.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
name: Create video
on:
push:
branches:
- master
paths:
- 'content/**'
- 'content/*.json'
- '**.json'
workflow_dispatch:
inputs:
debug_mode:
description: 'Debug with SSH'
type: boolean
required: false
default: false
env:
DEBUG: 1
AZURE_TTS_KEY: ${{ secrets.AZURE_TTS_KEY }}
AZURE_TTS_REGION: ${{ secrets.AZURE_TTS_REGION }}
GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }}
GOOGLE_CLIENT_SECRET: ${{ secrets.GOOGLE_CLIENT_SECRET }}
GOOGLE_REFRESH_TOKEN: ${{ secrets.GOOGLE_REFRESH_TOKEN }}
INSTAGRAM_EMAIL: ${{ secrets.INSTAGRAM_EMAIL }}
INSTAGRAM_PASSWORD: ${{ secrets.INSTAGRAM_PASSWORD }}
YOUTUBE_REFRESH_TOKEN: ${{ secrets.YOUTUBE_REFRESH_TOKEN }}
GOOGLE_MAKERSUITE_API_KEY: ${{ secrets.GOOGLE_MAKERSUITE_API_KEY }}
IMAGE_GENERATOR_URL: ${{ secrets.IMAGE_GENERATOR_URL }}
IMAGE_GENERATOR_API_KEY: ${{ secrets.IMAGE_GENERATOR_API_KEY }}
# ACTIONS_RUNNER_DEBUG: true
# ACTIONS_STEP_DEBUG: true
jobs:
TextToSpeech:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Node.JS environment
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 8
- name: podcast-maker CLI cache
uses: actions/cache@v3
id: podcast-maker-cache
with:
path: |
**/node_modules
dist
bin
key: cli-${{ hashFiles('**/package.json') }}-${{ hashFiles('**/pnpm.lock') }}
- name: Build
if: steps.podcast-maker-cache.outputs.cache-hit != 'true'
run: |
pnpm i
pnpm build
- name: Move content file to be processed
run: |
File=$(ls content/*.json | sort -n -t '-' -k 1 | tail -n 1)
Destination=$(./bin/dev info content --dir)
echo "Coping from $File to $Destination"
cp $File $Destination
- name: Get tmp path
id: tmp
run: echo "tmpPath=$(./bin/run info tmp --dir)" >> $GITHUB_OUTPUT
- name: Create TTS
run: ./bin/run create tts
- name: Save TTS files in Artifacts
uses: actions/upload-artifact@v3
with:
name: audio-files
path: |
${{ steps.tmp.outputs.tmpPath }}/*.mp3
${{ steps.tmp.outputs.tmpPath }}/*.json
!${{ steps.tmp.outputs.tmpPath }}/example.json
retention-days: 3
- name: SSH debug
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3
with:
limit-access-to-actor: true
YouTube:
needs: [TextToSpeech]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Node.JS environment
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 8
- name: Install FFMPEG
uses: FedericoCarboni/setup-ffmpeg@v1
- name: podcast-maker CLI cache
uses: actions/cache@v3
id: podcast-maker-cache
with:
path: |
**/node_modules
dist
bin
key: cli-${{ hashFiles('**/package.json') }}-${{ hashFiles('**/pnpm.lock') }}
- name: Build
if: steps.podcast-maker-cache.outputs.cache-hit != 'true'
run: |
pnpm i
pnpm build
- name: Get tmp path
id: tmp
run: echo "tmpPath=$(./bin/run info tmp --dir)" >> $GITHUB_OUTPUT
- name: Download TTS files
uses: actions/download-artifact@v3
with:
name: audio-files
path: ${{ steps.tmp.outputs.tmpPath }}/
- name: Link public folder to tmp
run: |
Tmp=$(./bin/run info tmp --dir)
echo "Linking $Tmp to public"
ln -sf $Tmp public
- name: Debug
if: ${{ inputs.debug_mode }}
uses: mxschmitt/action-tmate@v3
with:
limit-access-to-actor: true
- name: Create Youtube video
run: ./bin/run create youtube --upload
- name: Save video in Artifacts
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: youtube-video-assets
path: |
${{ steps.tmp.outputs.tmpPath }}/*.mp4
${{ steps.tmp.outputs.tmpPath }}/*.jpeg
${{ steps.tmp.outputs.tmpPath }}/*.json
!${{ steps.tmp.outputs.tmpPath }}/example.json
retention-days: 2
- name: Save content in Artifacts
uses: actions/upload-artifact@v3
with:
name: content-file
path: |
${{ steps.tmp.outputs.tmpPath }}/*.json
!${{ steps.tmp.outputs.tmpPath }}/example.json
retention-days: 2
- name: SSH debug
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3
with:
limit-access-to-actor: true