-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (43 loc) · 1.59 KB
/
upload-to-s3.yml
File metadata and controls
53 lines (43 loc) · 1.59 KB
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
47
48
49
50
51
52
53
name: Upload illustrations to S3
on:
pull_request:
branches: [main]
types: [closed]
jobs:
upload:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
- name: Check version is next release
run: |
REPO_VERSION=$(cat VERSION | tr -d '[:space:]')
PROD_VERSION=$(curl -s https://reactome.org/ContentService/data/database/version | tr -d '[:space:]')
EXPECTED_VERSION=$((PROD_VERSION + 1))
echo "Repo VERSION: $REPO_VERSION"
echo "Production version: $PROD_VERSION"
echo "Expected next version: $EXPECTED_VERSION"
if [ "$REPO_VERSION" != "$EXPECTED_VERSION" ]; then
echo "::error::VERSION ($REPO_VERSION) does not match expected next release ($EXPECTED_VERSION). Skipping upload."
exit 1
fi
echo "VERSION=$REPO_VERSION" >> $GITHUB_ENV
- uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ vars.AWS_ROLE }}
aws-region: us-east-1
- name: Upload icons to S3
run: |
aws s3 sync icons/ "s3://${{ vars.S3_BUCKET }}/${{ env.VERSION }}/icons/svg/" \
--delete
- name: Upload EHLDs to S3
run: |
aws s3 sync ehld/ "s3://${{ vars.S3_BUCKET }}/${{ env.VERSION }}/ehld/" \
--delete
- name: Upload Statics to S3
run: |
aws s3 sync statics/ "s3://${{ vars.S3_BUCKET }}/${{ env.VERSION }}/statics/" \
--delete