Upload artifacts to S3 #61
Workflow file for this run
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 artifacts to S3 | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- "v*.*.*" | |
jobs: | |
build: | |
uses: ./.github/workflows/build.yaml # use the callable build job to run build | |
deploy: | |
runs-on: ubuntu-latest | |
needs: [build] # require build to pass before deploy runs | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set Package Version | |
shell: bash | |
run: | | |
echo "version=$(<VERSION)" >> $GITHUB_ENV | |
echo "=== PKG_VERSION=$version ===" | |
echo "RELEASE=$(python -c "import yaml; print(yaml.safe_load(open('datamodel.yaml'))['model']['revision'])")" >> $GITHUB_ENV | |
echo "=== RELEASE=$RELEASE ===" | |
- name: Download assets from build | |
uses: actions/download-artifact@v4 | |
with: | |
name: geology-data-model-${{ env.RELEASE }} | |
- name: Upload folder to bucket | |
uses: a-sync/s3-uploader@master | |
with: | |
args: --recursive --exclude "*.log" | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_REGION: 'eu-central-1' | |
S3_BUCKET: ${{ secrets.AWS_BUCKET }} | |
S3_KEY: 'datamodel' | |
FILE: './outputs' | |