update github action to also upload environment configs to s3 #28
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: Upload Cookbooks & Configs to S3 | |
on: [push] | |
jobs: | |
compress: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
- name: Compress Cookbooks | |
run: | | |
cd .. | |
tar -czvf cookbooks.tar.gz -C ${{ github.workspace }} . | |
- 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: us-east-1 | |
- name: Upload to S3 | |
run: | | |
aws s3 cp ${{ github.workspace }}/../cookbooks.tar.gz s3://ssm.jumbledev.com/${{ github.ref_name }}/cookbooks.tar.gz | |
aws s3 cp ${{ github.workspace }}/.chef/environments/* s3://ssm.jumbledev.com/${{ github.ref_name }}/environments | |