Skip to content

fix(sre-6980): use latest moongodb dependencies #13

fix(sre-6980): use latest moongodb dependencies

fix(sre-6980): use latest moongodb dependencies #13

Workflow file for this run

name: Alerta Workable CI
on:
push:
tags:
- workable-*
pull_request:
branches:
- workable-*
permissions:
contents: read
jobs:
detect-noop:
permissions:
actions: write # for fkirc/skip-duplicate-actions to skip or stop workflow runs
contents: read # for fkirc/skip-duplicate-actions to read and compare commits
runs-on: ubuntu-latest
outputs:
noop: ${{ steps.noop.outputs.should_skip }}
steps:
- name: Detect No-op Changes
id: noop
uses: fkirc/skip-duplicate-actions@f75f66ce1886f00957d99748a42c724f4330bdcf # v5.3.1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
paths_ignore: '["**.md", "**.png", "**.jpg"]'
do_not_skip: '["workflow_dispatch", "schedule", "push"]'
concurrent_skipping: false
# lint:
# runs-on: ubuntu-latest
# needs: detect-noop
# if: needs.detect-noop.outputs.noop != 'true' && github.ref != 'refs/heads/main'
# steps:
# - name: Checkout
# uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
# - name: Lint Dockerfile
# run: make lint
# unit-tests:
# runs-on: ubuntu-latest
# needs: detect-noop
# if: needs.detect-noop.outputs.noop != 'true'
# steps:
# - name: Checkout
# uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
# - name: Run Unit Tests (Postgres)
# run: make test.unit BACKEND=postgres IMAGE_NAME=alerta-test
# - name: Run Unit Tests (MongoDB)
# run: make test.unit BACKEND=mongodb IMAGE_NAME=alerta-test
publish-artifacts:
# needs: [lint, unit-tests]
if: ${{ needs.detect-noop.outputs.noop != 'true' && startsWith(github.ref, 'refs/tags/workable-') }}
permissions:
id-token: write
contents: read
runs-on: ubuntu-latest
environment: Workable
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Get image tag
id: container-info
run: |
echo "image-tag=${GITHUB_REF#refs/tags/workable-}" >> $GITHUB_OUTPUT
- name: Build image
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6.9.1
with:
context: .
file: workable-Dockerfile
push: false
tags: Workable/alerta-base:${{ steps.container-info.outputs.image-tag }}
provenance: false
# DISTRIBUTION OF SRE IMAGE
- name: Login to sre registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
registry: us-docker.pkg.dev
username: _json_key
password: ${{ secrets.SRE_GCR_SA }}
- name: Push image to sre registry
env:
REGISTRY: us-docker.pkg.dev/sre-artifacts-20e4/gcr.io
run: |
docker tag Workable/alerta-base:${{ steps.container-info.outputs.image-tag }} \
${{ env.REGISTRY }}/alerta-base:${{ steps.container-info.outputs.image-tag }}
docker push ${{ env.REGISTRY }}/alerta-base:${{ steps.container-info.outputs.image-tag }}
# DISTRIBUTION OF STAGING IMAGE
- name: Login to staging registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
registry: us-docker.pkg.dev
username: _json_key
password: ${{ secrets.STAGING_GCR_SA }}
- name: Push image to staging registry
env:
REGISTRY: us-docker.pkg.dev/staging-artifacts-786a/gcr.io
run: |
docker tag Workable/alerta-base:${{ steps.container-info.outputs.image-tag }} \
${{ env.REGISTRY }}/alerta-base:${{ steps.container-info.outputs.image-tag }}
docker push ${{ env.REGISTRY }}/alerta-base:${{ steps.container-info.outputs.image-tag }}
# DISTRIBUTION OF PRODUCTION IMAGE
- name: Login to production registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
registry: us-docker.pkg.dev
username: _json_key
password: ${{ secrets.PRODUCTION_GCR_SA }}
- name: Push image to production registry
env:
REGISTRY: us-docker.pkg.dev/production-artifacts-0b0d/gcr.io
run: |
docker tag Workable/alerta-base:${{ steps.container-info.outputs.image-tag }} \
${{ env.REGISTRY }}/alerta-base:${{ steps.container-info.outputs.image-tag }}
docker push ${{ env.REGISTRY }}/alerta-base:${{ steps.container-info.outputs.image-tag }}