feat: new operator bundle for operator-sdk v3 (#62) #51
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 | |
on: | |
workflow_dispatch: {} | |
push: | |
branches: | |
- "main" | |
- "release-*" | |
jobs: | |
image_build: | |
name: Image build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- id: image_tag | |
run: | | |
BRANCH="${GITHUB_REF#refs/heads/}" | |
if [ "$BRANCH" == 'main' ] ; then | |
echo "::set-output name=tag::latest" | |
else | |
echo "::set-output name=tag::$BRANCH" | |
fi | |
- run: echo "${{ secrets.QUAY_BOT_PASSWORD }}" | docker login --username "${{ secrets.QUAY_BOT_USERNAME }}" --password-stdin quay.io | |
- name: build container image | |
run: | | |
VERSION='${{ steps.image_tag.outputs.tag }}' make docker-build | |
VERSION='${{ steps.image_tag.outputs.tag }}' make bundle-build | |
- name: push images to quay | |
run: | | |
VERSION='${{ steps.image_tag.outputs.tag }}' make docker-push | |
VERSION='${{ steps.image_tag.outputs.tag }}' make bundle-push | |
- name: success slack notification | |
uses: rtCamp/action-slack-notify@v2 | |
env: | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
SLACK_ICON: https://github.com/actions.png?size=48 | |
SLACK_MESSAGE: "Built and pushed quay.io/konveyor/move2kube-operator:${{ steps.image_tag.outputs.tag }}" | |
SLACK_TITLE: Success | |
SLACK_USERNAME: GitHubActions | |
- if: failure() | |
name: failure slack notification | |
uses: rtCamp/action-slack-notify@v2 | |
env: | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
SLACK_COLOR: "#BD3232" | |
SLACK_ICON: https://github.com/actions.png?size=48 | |
SLACK_MESSAGE: "Failed to build and push image quay.io/konveyor/move2kube-operator:${{ steps.image_tag.outputs.tag }}" | |
SLACK_TITLE: Failed | |
SLACK_USERNAME: GitHubActions |