Publish to S3 #73
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: Publish to S3 | |
on: | |
workflow_run: | |
workflows: ["Run Code Checks"] | |
branches: [develop] | |
types: | |
- completed | |
jobs: | |
publish-s3: | |
if: | | |
github.repository == 'opendatacube/odc-stac' | |
&& github.event.workflow_run.conclusion == 'success' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/cache@v3 | |
id: wheels_cache | |
with: | |
path: ./wheels | |
key: wheels-${{ github.sha }} | |
- name: Prepare for upload to S3 | |
run: | | |
mkdir -p ./pips | |
./scripts/mk-pip-tree.sh ./wheels/dev/ ./pips | |
find ./pips -type f | |
- name: Upload to S3 | |
run: | | |
echo "Using Keys: ...${AWS_ACCESS_KEY_ID:(-4)}/...${AWS_SECRET_ACCESS_KEY:(-4)}" | |
aws s3 ls "${S3_DST}" | |
aws s3 sync ./pips/ "${S3_DST}" | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_KEY }} | |
AWS_DEFAULT_REGION: 'ap-southeast-2' | |
AWS_REGION: 'ap-southeast-2' | |
S3_DST: 's3://datacube-core-deployment/' |