Merge pull request #3277 from alimness/stage #430
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: download-video | |
on: | |
push: | |
branches: | |
- stage | |
paths: | |
- 'video-links.txt' | |
jobs: | |
download-video: | |
if: (github.repository == 'Adventech/sabbath-school-lessons') | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup yt-dlp | |
uses: AnimMouse/[email protected] | |
with: | |
with-ffmpeg: true | |
- uses: actions/checkout@v2 | |
- name: Create work dir folder | |
run: mkdir ss-video | |
- name: Split video-links | |
run: split -l 14 video-links.txt split_video_links_ | |
- run: | | |
if [ -f "../split_video_links_aa" ]; then | |
sed -i '/^yt-dlp/ s/$/ --proxy="${{ secrets.PROXY }}"/' ../split_video_links_* | |
fi | |
test -f ../split_video_links_aa && for file in ../split_video_links_*; do | |
echo "Processing $file..." | |
bash "$file" | |
aws s3 cp . s3://sabbath-school-media-tmp --region us-east-1 --acl "public-read" --recursive | |
rm -rf ./* | |
done || true | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
working-directory: ss-video | |
aggregate-video: | |
if: (github.repository == 'Adventech/sabbath-school-lessons') | |
needs: download-video | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
ref: stage | |
fetch-depth: 0 | |
persist-credentials: false | |
github_token: ${{ secrets.PERSONAL_GH_TOKEN }} | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: '16' | |
check-latest: true | |
- name: Add token for private packages | |
run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.PACKAGES_SECRET }}" >> .npmrc | |
- run: npm install | |
- name: Aggregate video | |
run: node ./runners/content-aggregator/video.js | |
- run: rm package-lock.json | |
- name: Reset .npmrc | |
run: git restore .npmrc | |
- name: Commit & Push changes | |
uses: actions-js/[email protected] | |
with: | |
branch: 'stage' | |
github_token: ${{ secrets.PERSONAL_GH_TOKEN }} |