Skip to content

Commit

Permalink
Merge pull request #11 from reactome/update-ci
Browse files Browse the repository at this point in the history
public ecr
  • Loading branch information
DerekTang04 authored Mar 23, 2024
2 parents 2f0094a + 31861b1 commit c9fa876
Show file tree
Hide file tree
Showing 2 changed files with 294 additions and 291 deletions.
39 changes: 21 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,25 @@
name: analysis core ci


on:
workflow_dispatch:

workflow_dispatch:
pull_request:
types:
- opened
- synchronize

- synchronize
push:
branches:
- master


permissions:
id-token: write
contents: read


jobs:
lint:
if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-latest
env:
REPO_DIR : /opt/analysis-core
REPO_DIR: /opt/analysis-core
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -64,26 +59,34 @@ jobs:
needs: docker-build
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
name: image-artifact
path: /tmp

- id: get-hash
run: |
FULL_SHA=${{ github.sha }}
echo "SHORT_SHA=${FULL_SHA:0:7}" >> $GITHUB_OUTPUT
- env:
AWS_REGION : us-east-1
AWS_REGION: us-east-1
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ vars.AWS_ROLE }}
aws-region: ${{ env.AWS_REGION }}

- id: login-ecr
uses: aws-actions/amazon-ecr-login@v2

- uses: actions/download-artifact@v4
with:
name: image-artifact
path: /tmp
registry-type: public

- env:
AWS_REGISTRY : ${{ steps.login-ecr.outputs.registry }}
AWS_REPO : analysis-core
IMG_TAG : latest
AWS_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
AWS_REGISTRY_ALIAS: k2y5k6e2
AWS_REPO: analysis-core
IMG_TAG: ${{ steps.get-hash.outputs.SHORT_SHA }}
run: |
docker load --input /tmp/image.tar
docker image tag tmp-tag $AWS_REGISTRY/$AWS_REPO:$IMG_TAG
docker push $AWS_REGISTRY/$AWS_REPO:$IMG_TAG
docker image tag tmp-tag $AWS_REGISTRY/$AWS_REGISTRY_ALIAS/$AWS_REPO:$IMG_TAG
docker push $AWS_REGISTRY/$AWS_REGISTRY_ALIAS/$AWS_REPO:$IMG_TAG
Loading

0 comments on commit c9fa876

Please sign in to comment.