Merge pull request #6 from bmeg/feature/tests #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and publish grip graphql plugin server image | |
on: | |
push: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Login to Quay.io | |
uses: docker/login-action@v3 | |
with: | |
registry: quay.io | |
username: ${{ secrets.QUAY_USERNAME }} | |
password: ${{ secrets.QUAY_ROBOT_TOKEN }} | |
- name: Build and push image | |
run: | | |
# Set Image tag to the branch name | |
BRANCH=$(echo ${GITHUB_REF#refs/*/} | tr / _) | |
REPO=quay.io/ohsu-comp-bio/grip-caliper | |
echo "Setting image tag to $REPO:$BRANCH" | |
# Login to Quay.io and build image | |
docker login quay.io | |
docker build -t $REPO:$BRANCH . | |
# Add 'latest' tag to 'main' image | |
if [[ $BRANCH == 'main' ]]; then | |
docker image tag $REPO:main $REPO:latest | |
fi | |
# Push the tagged image to Quay.io | |
docker push --all-tags $REPO |