diff --git a/.github/workflows/deploy-api.yml b/.github/workflows/deploy-api.yml index b4d94da3..b464e6fb 100644 --- a/.github/workflows/deploy-api.yml +++ b/.github/workflows/deploy-api.yml @@ -30,7 +30,7 @@ on: workflow_dispatch: inputs: null -name: Deploy pephub.databio.org API to AWS - primary +name: Deploy API to AWS - primary jobs: deploy: @@ -40,7 +40,8 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 + - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1 with: @@ -55,16 +56,13 @@ jobs: - name: Build, tag, and push image to Amazon ECR id: build-image env: - ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} - ECR_REPOSITORY: pephub + REGISTRY: ${{ steps.login-ecr.outputs.registry }} + REPOSITORY: pephub IMAGE_TAG: ${{ github.sha }} run: | - # Build a docker container and - # push it to ECR so that it can - # be deployed to ECS. - docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG deployment/pephub.databio.org/. + docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -f deployment/pephub.databio.org/Dockerfile . docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG - echo "::set-output name=image::$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" + echo "image=$REGISTRY/$REPOSITORY:$IMAGE_TAG" >> $GITHUB_OUTPUT - name: Fill in the new image ID in the Amazon ECS task definition id: task-def diff --git a/.github/workflows/deploy-dockerhub.yml b/.github/workflows/deploy-dockerhub.yml index 606f7c5c..981e3b63 100644 --- a/.github/workflows/deploy-dockerhub.yml +++ b/.github/workflows/deploy-dockerhub.yml @@ -25,5 +25,7 @@ jobs: uses: docker/build-push-action@v5 with: push: true - context: '{{defaultContext}}:mysubdir' - tags: databio/pephub:latest + context: '{{defaultContext}}:deployment/Dockerhub' + tags: + - databio/pephub:latest + - databio/pephub:${{github.ref_name}}