crispr submission bug #53
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
name: production | |
on: | |
push: | |
tags: [ '*.*.*' ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Remove unnecessary files | |
run: | | |
sudo rm -rf /usr/share/dotnet | |
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
- 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 | |
APP_VERSION=${GITHUB_REF#refs/*/} | |
git clone https://github.com/mpg-age-bioinformatics/flaski.git ${APP_VERSION} | |
cd ${APP_VERSION} | |
git checkout ${APP_VERSION} | |
git submodule update --init --recursive | |
cd pyflaski && PYFLASKI_VERSION=$(git rev-parse --short HEAD) && cd ../ | |
docker buildx create --name mybuilder --driver docker-container --bootstrap --use | |
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes | |
docker buildx build --platform linux/amd64,linux/arm64 --build-arg APP_VERSION=${APP_VERSION} --build-arg PYFLASKI_VERSION=${PYFLASKI_VERSION} --no-cache -t docker.io/mpgagebioinformatics/flaski:stable -t docker.io/mpgagebioinformatics/flaski:${APP_VERSION} -t docker.io/mpgagebioinformatics/flaski:latest --push . | |
- name: Set Success env | |
run: echo "GITHUB_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV && echo "GITHUB_SHA_SHORT=$(echo $GITHUB_SHA | cut -c 1-8)" | |
- name: Slack Success Notification | |
run: | | |
generate_post_data() | |
{ | |
cat << EOF | |
{ | |
"deployment":"server","namespace":"flaski-prod", "container" :"server","image":"mpgagebioinformatics/flaski", "tag":"$GITHUB_TAG" ,"SHA":"$GITHUB_SHA_SHORT" | |
} | |
EOF | |
} | |
curl --insecure -H "Content-Type: application/json" -X POST -d "$(generate_post_data)" ${{ secrets.ROLLOUT_WEBHOOK }} | |
- name: Set Failure env | |
if: failure() | |
run: echo "GITHUB_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV && echo "GITHUB_SHA_SHORT=$(echo $GITHUB_SHA | cut -c 1-8)" | |
- name: Slack Failure Notification | |
if: failure() | |
run: | | |
generate_post_data() | |
{ | |
cat << EOF | |
{ | |
"text": "flaski $GITHUB_TAG build and push FAILED" | |
} | |
EOF | |
} | |
curl -H "Content-Type: application/json" -X POST -d "$(generate_post_data)" ${{ secrets.SLACK_WEBHOOK }} | |