Skip to content

azimuth

azimuth #132

Workflow file for this run

name: production
on:
push:
tags: [ '*' ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build the Docker image
run: |
echo "${{ secrets.DOCKER_HUB_TOKEN }}" | docker login -u "${{ secrets.DOCKER_HUB_USERNAME }}" --password-stdin docker.io
TOOL="$(echo ${GITHUB_REF#refs/*/} | cut -d '-' -f 1 )"
VERS="$(echo ${GITHUB_REF#refs/*/} | cut -d '-' -f 2- )"
git clone https://github.com/mpg-age-bioinformatics/software.git ${GITHUB_REF#refs/*/}
cd ${GITHUB_REF#refs/*/}
git checkout ${GITHUB_REF#refs/*/}
cd ${TOOL}/${VERS}
docker build --no-cache -t docker.io/mpgagebioinformatics/${TOOL}:${VERS} .
docker push docker.io/mpgagebioinformatics/${TOOL}:${VERS}
- name: Set Success env
run: echo "GITHUB_SHA_SHORT=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Slack Success Notification
run: |
generate_post_data()
{
cat << EOF
{
"text": "$GITHUB_SHA_SHORT build and push completed"
}
EOF
}
curl -H "Content-Type: application/json" -X POST -d "$(generate_post_data)" ${{ secrets.SLACK_WEBHOOK }}
- name: Set Failure env
if: failure()
run: echo "GITHUB_SHA_SHORT=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Slack Failure Notification
if: failure()
run: |
generate_post_data()
{
cat << EOF
{
"text": "$GITHUB_SHA_SHORT build and push FAILED"
}
EOF
}
curl -H "Content-Type: application/json" -X POST -d "$(generate_post_data)" ${{ secrets.SLACK_WEBHOOK }}