Skip to content

Commit c16b285

Browse files
Merge pull request #2 from reactome/release/96
Add S3 upload workflow for merged PRs
2 parents 24159e1 + cc78a3c commit c16b285

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

.github/workflows/upload-to-s3.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Upload illustrations to S3
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
types: [closed]
7+
8+
jobs:
9+
upload:
10+
if: github.event.pull_request.merged == true
11+
runs-on: ubuntu-latest
12+
permissions:
13+
id-token: write
14+
contents: read
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Check version is next release
19+
run: |
20+
REPO_VERSION=$(cat VERSION | tr -d '[:space:]')
21+
PROD_VERSION=$(curl -s https://reactome.org/ContentService/data/database/version | tr -d '[:space:]')
22+
EXPECTED_VERSION=$((PROD_VERSION + 1))
23+
24+
echo "Repo VERSION: $REPO_VERSION"
25+
echo "Production version: $PROD_VERSION"
26+
echo "Expected next version: $EXPECTED_VERSION"
27+
28+
if [ "$REPO_VERSION" != "$EXPECTED_VERSION" ]; then
29+
echo "::error::VERSION ($REPO_VERSION) does not match expected next release ($EXPECTED_VERSION). Skipping upload."
30+
exit 1
31+
fi
32+
33+
echo "VERSION=$REPO_VERSION" >> $GITHUB_ENV
34+
35+
- uses: aws-actions/configure-aws-credentials@v4
36+
with:
37+
role-to-assume: ${{ vars.AWS_ROLE }}
38+
aws-region: us-east-1
39+
40+
- name: Upload icons to S3
41+
run: |
42+
aws s3 sync icons/ "s3://${{ vars.S3_BUCKET }}/${{ env.VERSION }}/icons/svg/" \
43+
--delete
44+
45+
- name: Upload EHLDs to S3
46+
run: |
47+
aws s3 sync ehld/ "s3://${{ vars.S3_BUCKET }}/${{ env.VERSION }}/ehld/" \
48+
--delete

0 commit comments

Comments
 (0)