fix misc bugs #209
Workflow file for this run
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
# Workflow for building the ACED ETL image and pushing it to the quay.io repository | |
# | |
# Optionally debug via SSH | |
# Ref: https://fleetdm.com/engineering/tips-for-github-actions-usability | |
# | |
# To use this step uncomment and place anywhere in the build steps. The build will pause on this step and | |
# output a ssh address associated with the Github action worker. Helpful for debugging build steps and | |
# and intermediary files/artifacts. | |
# | |
# - name: Setup tmate session | |
# uses: mxschmitt/action-tmate@v3 | |
name: Build and publish ACED ETL image | |
on: | |
push: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- name: Login to Quay.io | |
uses: docker/login-action@v2 | |
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/aced-etl | |
echo "Setting image tag to $REPO:$BRANCH" | |
# Login to Quay.io and build image | |
docker login quay.io | |
docker build -t $REPO:$BRANCH ./etl-job | |
# 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 |