-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (38 loc) · 1.23 KB
/
larch_to_s3.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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 latest release tag
id: get_latest_tag
run: |
TOKEN="${{ secrets.GITHUB_TOKEN }}"
VERSION=$(curl -s -H "Authorization: Bearer $TOKEN" "https://api.github.com/repos/${{ github.repository }}/releases/latest" | jq -r .tag_name)
echo "RELEASE_TAG=${VERSION}" >> $GITHUB_ENV
- name: Zip repository
run: |
zip -r "larch_${RELEASE_TAG}.zip" .
zip -r "larch_latest.zip" .
- name: Configure AWS 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_${RELEASE_TAG}.zip" s3://impact-repo-dependencies/larch/
aws s3 cp "./larch_latest.zip" s3://impact-repo-dependencies/larch/