-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (31 loc) · 986 Bytes
/
build.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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