ci: rename the custom github actions to use the new repo names (#81) #70
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: | |
# copy the helm chart from the UI repo | |
- name: checkout-the-ui-repo | |
uses: actions/checkout@v2 | |
with: | |
repository: 'konveyor/move2kube-ui' | |
- name: copy-helm-chart-into-tmp | |
run: cp -r helm-charts/ /tmp/helm-charts-move2kube | |
- name: cleanup | |
run: rm -rf {*,.*} || true | |
- name: checkout-the-current-repo | |
uses: actions/checkout@v2 | |
- name: copy-helm-chart-into-pwd | |
run: rm -rf helm-charts/ && cp -r /tmp/helm-charts-move2kube helm-charts | |
# build the operator container image | |
- id: image_tag | |
run: | | |
BRANCH="${GITHUB_REF#refs/heads/}" | |
if [ "$BRANCH" == 'main' ] ; then | |
echo "tag=latest" >> $GITHUB_OUTPUT | |
else | |
echo "tag=$BRANCH" >> $GITHUB_OUTPUT | |
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 | |
- name: push images to quay | |
run: | | |
VERSION='${{ steps.image_tag.outputs.tag }}' make docker-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 |