Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use reusable image deploy #510

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions .github/workflows/deploy_tagged.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,14 @@ name: Tagged release deploy

on:
workflow_dispatch:
inputs:
changelist:
description: 'patch and pre-release metadata'
required: true
default: '.0-alpha.1'


jobs:
call-reusable-tagged-release:
uses: dockstore/workflow-actions/.github/workflows/deploy_tagged.yaml@main
uses: dockstore/workflow-actions/.github/workflows/deploy_tagged.yaml@seab-6771/reusable-image-deploy
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Presumably you'll change this to main after your other PR is merged?

secrets: inherit

deploy_image:
uses: dockstore/workflow-actions/.github/workflows/deploy_image.yaml@seab-6771/reusable-image-deploy
with:
changelist: ${{ inputs.changelist }}
createDockerImage: true
dockerTagPrefix: 'quay.io/dockstore/dockstore-support'
quayRepository: dockstore-support
secrets: inherit
38 changes: 10 additions & 28 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,32 +33,14 @@ jobs:
- name: code coverage
run: bash <(curl -s https://codecov.io/bash)

- if: github.ref == 'refs/heads/develop'
name: Set S3 folder name and quay tag name
run: |
S3_FOLDER=${GITHUB_REF##refs/tags/}
if [ $GITHUB_REF == $S3_FOLDER ]; then
# If this isn't a tag, it must be a branch
S3_FOLDER=${GITHUB_REF##refs/heads/}
fi
# QUAY_TAG differs from S3_FOLDER because it only contains the git ref with no short hash. It also replaces slashes with underscores.
echo "QUAY_TAG=${S3_FOLDER//\//_}" >> $GITHUB_ENV
echo "S3_FOLDER=${S3_FOLDER}-$(echo $GITHUB_SHA | cut -c -7)" >> $GITHUB_ENV

# neat, quay itself uses manual github actions https://github.com/quay/quay/blob/master/.github/workflows/build-and-publish.yaml
- if: github.ref == 'refs/heads/develop'
name: Login to Quay.io
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAY_USER }}
password: ${{ secrets.QUAY_TOKEN }}
deploy_image:
uses: dockstore/workflow-actions/.github/workflows/deploy_image.yaml@seab-6771/reusable-image-deploy
if: ${{ github.ref == 'refs/heads/develop' || github.ref_type == 'tag' }}
with:
quayRepository: dockstore-support
secrets: inherit

- if: github.ref == 'refs/heads/develop'
name: Build and push
id: docker_build
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: quay.io/dockstore/dockstore-support:${{env.QUAY_TAG}}
deploy_tagged:
if: github.ref_type == 'tag'
uses: dockstore/workflow-actions/.github/workflows/deploy_tagged.yaml@seab-6771/reusable-image-deploy
secrets: inherit

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Little bit confused by deploy_image and deploy_tagged, they seem similar. Why not just [the functionality of] deploy_image on its own?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deploy_image deploys the image to quay and uploads the image digest to S3.

deploy_tagged uploads the tagged release to artifactory.

They could arguably be combined (at least from the POV of this repo), but not all of our repositories require uploading the artifacts to artifactory, which is why I separated out deploy_image and deploy_tagged.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good code comment