From 30e318ee227387c955239859b971d774496f08ed Mon Sep 17 00:00:00 2001 From: jonathan langlois Date: Fri, 25 Oct 2024 14:47:29 -0700 Subject: [PATCH] test: grafana publish publish grafana in ci pipeline --- .github/workflows/publish-grafana-image.yaml | 52 ++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/publish-grafana-image.yaml diff --git a/.github/workflows/publish-grafana-image.yaml b/.github/workflows/publish-grafana-image.yaml new file mode 100644 index 0000000..a54d610 --- /dev/null +++ b/.github/workflows/publish-grafana-image.yaml @@ -0,0 +1,52 @@ +name: Create and publish SSO Aggregator + +on: + push: + branches: + - main + - dev + - ssoteam-2010 + paths: + - grafana-config/* + +env: + GITHUB_REGISTRY: ghcr.io + IMAGE_NAME: bcgov/grafana + +jobs: + build-and-push-image: + runs-on: ubuntu-22.04 + permissions: + contents: read + packages: write + + steps: + - uses: hmarr/debug-action@v3 + - uses: actions/checkout@v4 + + - name: Setup Tools + uses: ./.github/actions/setup-tools + + - name: Log in to the GitHub Container registry + uses: docker/login-action@v3 + with: + registry: ${{ env.GITHUB_REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.GITHUB_REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=ref,event=branch + type=sha,format=long + + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: aggregator + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}