Merge pull request #15 from timelessnesses/patch-1 #59
This file contains hidden or 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: Sync to S3 | |
| on: | |
| push: | |
| branches: | |
| - master | |
| jobs: | |
| deploy_legacy: | |
| name: Upload to legacy Amazon S3 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| - name: Configure AWS credentials | |
| uses: aws-actions/configure-aws-credentials@v1 | |
| with: | |
| aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| aws-region: ap-southeast-1 | |
| - name: Copy files to S3 with the AWS CLI | |
| run: | | |
| aws s3 sync ./statements/pdf s3://beta-programming-in-th/statements --acl public-read | |
| deploy: | |
| name: Upload to Digital Ocean S3 | |
| runs-on: ubuntu-latest | |
| env: | |
| SPACE_NAME: prginth01 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| - name: Set up S3cmd cli tool | |
| uses: s3-actions/[email protected] | |
| with: | |
| provider: digitalocean | |
| region: "sgp1" | |
| access_key: ${{ secrets.S3_ACCESS_KEY }} | |
| secret_key: ${{ secrets.S3_SECRET_KEY }} | |
| - name: Copy files to S3 with the s3cmd | |
| run: | | |
| s3cmd sync --recursive --acl-public ./statements/pdf s3://${{ env.SPACE_NAME }}/statements/ |