Skip to content

chore: autopublish 2024-12-13T13:22:02Z #43

chore: autopublish 2024-12-13T13:22:02Z

chore: autopublish 2024-12-13T13:22:02Z #43

Workflow file for this run

name: deploy-video
on:
push:
branches:
- prod
- stage
paths:
- '.github/workflows/deploy-video.yml'
- 'ops/deploy/deploy-video.js'
- 'src/**/video.yml'
jobs:
deploy-video:
if: (github.repository == 'Adventech/sabbath-school-resources')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
name: Fetch the repository files
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- uses: actions/setup-node@v3
name: Setup Node
with:
node-version: '16'
- name: Add token for private packages
run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.PACKAGES_SECRET }}" >> .npmrc
- run: npm install --global yarn
name: Install Yarn
- run: yarn install
name: Installing dependencies
- run: gpg --quiet --batch --yes --decrypt --passphrase="$CREDS_PASSPHRASE" --output deploy-creds.tar deploy-creds.tar.gpg
env:
CREDS_PASSPHRASE: ${{ secrets.CREDS_PASSPHRASE }}
working-directory: ops/deploy/creds
- run: tar xvf deploy-creds.tar
working-directory: ops/deploy/creds
- run: mkdir media
- name: Sync from cloud
run: aws s3 sync s3://sabbath-school-resources-media`[[ "${{ steps.extract_branch.outputs.branch }}" = "stage" ]] && echo '-stage'`.adventech.io media --region us-east-1 --no-progress --exclude "*" --include "video/*/ss/`node --input-type=module -e 'import {getPreviousQuarter} from "./ops/helpers/helpers.js"; console.log(getPreviousQuarter())'`*/*.keep" --include "video/*/ss/`node --input-type=module -e 'import {getCurrentQuarter} from "./ops/helpers/helpers.js"; console.log(getCurrentQuarter())'`*/*.keep" --include "video/*/ss/`node --input-type=module -e 'import {getNextQuarter} from "./ops/helpers/helpers.js"; console.log(getNextQuarter())'`*/*.keep" --include "video/*/aij/*/*.keep" --include "video/*/devo/*/*.keep" --include "video/*/pm/*/*.keep"
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- run: node ./ops/deploy/deploy-video.js -m "gen"
env:
DEPLOY_ENV: ${{ steps.extract_branch.outputs.branch }}
- run: rm -r media && mkdir media
- run: |
test -f curl-config-0.txt && for file in curl-config-*.txt; do
echo "Processing $file..."
curl -K "$file"
node ./ops/deploy/deploy-video.js -m "keep"
aws s3 sync ./media s3://sabbath-school-resources-media`[[ "${{ steps.extract_branch.outputs.branch }}" = "stage" ]] && echo '-stage'`.adventech.io --acl "public-read" --region us-east-1 --no-progress
rm -r media
done || true
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
DEPLOY_ENV: ${{ steps.extract_branch.outputs.branch }}
- run: node ./ops/deploy/deploy-video.js
env:
DEPLOY_ENV: ${{ steps.extract_branch.outputs.branch }}
- name: Deploying API
run: aws s3 cp dist/ s3://sabbath-school`[[ "${{ steps.extract_branch.outputs.branch }}" = "stage" ]] && echo '-stage'`.adventech.io --acl "public-read" --region us-east-1 --no-progress --recursive
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}