Build #812
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-*" | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v2-beta | |
with: | |
node-version: "16.16.0" | |
- run: corepack enable | |
- run: make install | |
- run: make build | |
- if: failure() | |
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: "Build failed in move2kube-ui ${{ github.ref }}" | |
SLACK_TITLE: Failed | |
SLACK_USERNAME: GitHubActions | |
image_build: | |
needs: [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 "tag=latest" >> $GITHUB_OUTPUT | |
else | |
echo "tag=$BRANCH" >> $GITHUB_OUTPUT | |
fi | |
- name: pull latest image to reuse layers | |
run: | | |
docker pull quay.io/konveyor/move2kube-ui:latest || true | |
docker pull quay.io/konveyor/move2kube-ui-builder:latest || true | |
- run: echo "${{ secrets.QUAY_BOT_PASSWORD }}" | docker login --username "${{ secrets.QUAY_BOT_USERNAME }}" --password-stdin quay.io | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: build image | |
run: VERSION='${{ steps.image_tag.outputs.tag }}' make cmultibuildpush | |
- name: build and push the operator container image | |
run: | | |
cd operator/ || exit 1 | |
VERSION='${{ steps.image_tag.outputs.tag }}' make docker-build | |
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-ui:${{ 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-ui:${{ steps.image_tag.outputs.tag }}" | |
SLACK_TITLE: Failed | |
SLACK_USERNAME: GitHubActions |