Skip to content

Commit

Permalink
Merge pull request #28 from NASA-IMPACT/larch_to_s3
Browse files Browse the repository at this point in the history
Larch to s3
  • Loading branch information
Caden-Helbling authored Feb 19, 2024
2 parents 65b1183 + 4f96b72 commit b0ab940
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/larch_to_s3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: larch to S3

permissions:
id-token: write
contents: read

on:
workflow_dispatch:
push:
branches:
- main
release:
types: [published]

jobs:
upload-larch-to-s3:
name: Upload larch to S3
runs-on: ubuntu-latest
steps:

- name: Checkout
uses: actions/checkout@v4

- name: Get Release Version
id: get_version
run: |
VERSION=$(curl -s "https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/latest" | jq -r .tag_name)
echo "Release version: $VERSION"
echo "::set-output name=version::$VERSION"
- name: Zip repository
run: |
zip -r "larch_${{ steps.get_version.outputs.version }}.zip" .
zip -r "larch_latest.zip" .
- name: ConfigureAWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::067782713062:role/admin-oidc
role-session-name: ${{ github.repository_owner}}
aws-region: us-east-1

- name: Upload to S3
run: |
aws s3 cp "./larch_${{ steps.get_version.outputs.version }}.zip" s3://impact-repo-dependancies/larch/
aws s3 cp "./larch_latest.zip" s3://impact-repo-dependancies/larch/

0 comments on commit b0ab940

Please sign in to comment.