Merge pull request #41 from cul-it/dev #15
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
# When the main branch changes, sync config files with staging S3 bucket. | |
# * copy config/authorities to S3/config/authorities | |
# * copy config/locale to S3/config/locale | |
name: sync-s3-stg | |
on: | |
workflow_dispatch: # allow for manually running through Actions tab | |
push: | |
branches: [ main ] # auto-run when files in listed paths change in the main branch | |
paths: | |
- 'config/authorities/**' | |
- 'config/locales/**' | |
jobs: | |
s3_update: | |
runs-on: ubuntu-latest | |
environment: staging | |
steps: | |
- uses: actions/checkout@master | |
- uses: jakejarvis/s3-sync-action@master | |
with: | |
args: --follow-symlinks --delete | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} | |
AWS_REGION: 'us-east-1' | |
SOURCE_DIR: 'config' | |
DEST_DIR: 'config' | |
wait_one_hour: | |
# reload-auths-stg workflow watches for the end of this workflow before reloading auths in the app | |
needs: s3_update | |
runs-on: ubuntu-latest | |
steps: | |
- uses: technote-space/auto-cancel-redundant-workflow@v1 | |
- name: wait-one-hour | |
run: sleep 1h |