Nightly build #1770
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: Nightly build | |
on: | |
schedule: | |
- cron: "0 3 * * *" | |
push: | |
branches: | |
- master | |
- main | |
env: | |
ORIGINAL_REPO_NAME: ${{ github.event.repository.full_name }} | |
jobs: | |
release: | |
name: Build and push docker images | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build args | |
run: | | |
echo "DATE=`date`" >> $GITHUB_ENV | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.K8S_AGENTS_DOCKERHUB_USERNAME }} | |
password: ${{ secrets.K8S_AGENTS_DOCKERHUB_TOKEN }} | |
- name: Build and push docker image | |
uses: docker/build-push-action@v6 | |
with: | |
build-args: | | |
"COMMIT=${{ github.sha }}" | |
"DATE=${{ env.DATE }}" | |
"TAG=nightly" | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
context: . | |
push: true | |
platforms: | | |
linux/amd64 | |
linux/arm64 | |
linux/arm | |
tags: newrelic/nri-kube-events:nightly | |
notify-failure: | |
if: ${{ always() && failure() }} | |
needs: [release] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Notify failure via Slack | |
uses: archive/[email protected] | |
with: | |
slack-bot-user-oauth-access-token: ${{ secrets.K8S_AGENTS_SLACK_TOKEN }} | |
slack-channel: ${{ secrets.K8S_AGENTS_SLACK_CHANNEL }} | |
slack-text: "❌ `${{ env.ORIGINAL_REPO_NAME }}`: <${{ github.server_url }}/${{ env.ORIGINAL_REPO_NAME }}/actions/runs/${{ github.run_id }}|'Nightly build' failed>." |