Skip to content

chore: autopublish 2024-03-27T20:14:11Z #8

chore: autopublish 2024-03-27T20:14:11Z

chore: autopublish 2024-03-27T20:14:11Z #8

Workflow file for this run

name: deploy
on:
push:
branches:
- master
- stage
paths:
- '**.js'
- 'src/**'
- 'images/**'
jobs:
deploy:
if: (github.repository == 'Adventech/sabbath-school-lessons')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v39
- name: List all changed files
run: |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
echo "$file was changed"
done
- name: Get changed files and write the outputs to a JSON file
id: changed-files-write-output-files-json
uses: tj-actions/changed-files@v39
with:
json: true
write_output_files: true
- name: Verify the contents of the .github/outputs/all_changed_files.json file
run: |
cat .github/outputs/all_changed_files.json
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- run: gpg --quiet --batch --yes --decrypt --passphrase="$CREDS_PASSPHRASE" --output deploy-creds.tar deploy-creds.tar.gpg
env:
CREDS_PASSPHRASE: ${{ secrets.CREDS_PASSPHRASE }}
- run: tar xvf deploy-creds.tar
- 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
- run: node deploy -b ${{ steps.extract_branch.outputs.branch }}
- name: Web deploy
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 }}
deploy_v2:
if: (github.repository == 'Adventech/sabbath-school-lessons')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v39
- name: List all changed files
run: |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
echo "$file was changed"
done
- name: Get changed files and write the outputs to a JSON file
id: changed-files-write-output-files-json
uses: tj-actions/changed-files@v39
with:
json: true
write_output_files: true
- name: Verify the contents of the .github/outputs/all_changed_files.json file
run: |
cat .github/outputs/all_changed_files.json
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- run: gpg --quiet --batch --yes --decrypt --passphrase="$CREDS_PASSPHRASE" --output deploy-creds.tar deploy-creds.tar.gpg
env:
CREDS_PASSPHRASE: ${{ secrets.CREDS_PASSPHRASE }}
- run: tar xvf deploy-creds.tar
- 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
- run: node deploy -b ${{ steps.extract_branch.outputs.branch }} -v 2
- name: Web deploy
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 }}