fix: check health on pending notifications #945
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: Create Release | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
semantic-release: | |
runs-on: ubuntu-latest | |
outputs: | |
release-version: ${{ steps.semantic.outputs.release-version }} | |
new-release-published: ${{ steps.semantic.outputs.new-release-published }} | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- uses: codfish/semantic-release-action@9a999e0cdb207de2c9d9d4276860435727818989 # v3.4.1 | |
id: semantic | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
binary: | |
runs-on: ubuntu-latest | |
needs: semantic-release | |
steps: | |
- name: Clear up disk space | |
run: | | |
rm -rf /usr/share/dotnet | |
rm -rf /opt/ghc | |
rm -rf /usr/local/share/boost | |
rm -rf $AGENT_TOOLSDIRECTORY | |
rm -rf /opt/hostedtoolcache | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- name: Install Go | |
uses: buildjet/setup-go@v5 | |
with: | |
go-version: v1.22.x | |
- uses: buildjet/cache@v4 | |
with: | |
path: | | |
~/go/pkg/mod | |
~/.cache/go-build | |
.bin | |
key: cache-${{ hashFiles('**/go.sum') }}-${{ hashFiles('.bin/*') }} | |
restore-keys: | | |
cache- | |
- run: make release | |
env: | |
VERSION: v${{ needs.semantic-release.outputs.release-version }} | |
- name: Upload binaries to release | |
uses: svenstaro/upload-release-action@04733e069f2d7f7f0b4aebc4fbdbce8613b03ccd # v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: ./.release/* | |
tag: v${{ needs.semantic-release.outputs.release-version }} | |
overwrite: true | |
file_glob: true | |
docker: | |
needs: semantic-release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- name: Set version | |
# Always use git tags as semantic release can fail due to rate limit | |
run: | | |
git fetch --prune --unshallow | |
echo "RELEASE_VERSION=$(git describe --abbrev=0 --tags | sed -e 's/^v//')" >> $GITHUB_ENV | |
- name: Publish to Registry | |
uses: elgohr/Publish-Docker-Github-Action@686ffe1e82bed6639d202a799708561d18f30712 # v5 | |
with: | |
name: flanksource/incident-commander | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
snapshot: true | |
tags: "latest,v${{ env.RELEASE_VERSION }}" | |
cache: true | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-access-key-id: ${{ secrets.ECR_AWS_ACCESS_KEY }} | |
aws-secret-access-key: ${{ secrets.ECR_AWS_SECRET_ACCESS_KEY }} | |
aws-region: us-east-1 | |
- name: Login to Amazon ECR Public | |
id: login-ecr-public | |
uses: aws-actions/amazon-ecr-login@v2 | |
with: | |
registry-type: public | |
- name: Publish to ECR Public | |
env: | |
REGISTRY: ${{ steps.login-ecr-public.outputs.registry }} | |
REGISTRY_ALIAS: k4y9r6y5 | |
REPOSITORY: incident-commander | |
IMAGE_TAG: "v${{ env.RELEASE_VERSION }}" | |
run: | | |
docker build -t $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG . | |
docker push $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG | |
update-incident-commander-chart: | |
if: needs.semantic-release.outputs.new-release-published == 'true' | |
runs-on: ubuntu-latest | |
needs: [semantic-release, docker] | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- name: Set version | |
# Always use git tags as semantic release can fail due to rate limit | |
run: | | |
git fetch --prune --unshallow | |
echo "RELEASE_VERSION=$(git describe --abbrev=0 --tags | sed -e 's/^v//')" >> $GITHUB_ENV | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
with: | |
repository: "${{ github.repository_owner }}/mission-control-chart" | |
token: ${{ secrets.FLANKBOT }} | |
path: ./incident-commander-chart | |
- name: Update image tags in chart | |
uses: mikefarah/yq@f654fbf4598c06e18b11a4bd504eba16459be80c # master | |
with: | |
cmd: yq -i e '.image.tag = "v${{ env.RELEASE_VERSION }}"' incident-commander-chart/chart/values.yaml | |
- name: Update image tags in agent chart | |
uses: mikefarah/yq@f654fbf4598c06e18b11a4bd504eba16459be80c # master | |
with: | |
cmd: yq -i e '.image.tag = "v${{ env.RELEASE_VERSION }}"' incident-commander-chart/agent-chart/values.yaml | |
- name: Update CRDs | |
run: | | |
cp config/crds/* incident-commander-chart/chart/crds/ | |
- name: Push changes to chart repo | |
uses: stefanzweifel/git-auto-commit-action@8621497c8c39c72f3e2a999a26b4ca1b5058a842 # v5.0.1 | |
with: | |
commit_message: "chore: update incident-commander image version to ${{ env.RELEASE_VERSION }}" | |
repository: ./incident-commander-chart | |
branch: main |