Skip to content

Commit

Permalink
Don't use shared-workflows/actions/build-push-to-dockerhub
Browse files Browse the repository at this point in the history
Signed-off-by: Marcelo E. Magallon <[email protected]>
  • Loading branch information
mem committed Oct 18, 2024
1 parent d30e11f commit 451af09
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 18 deletions.
47 changes: 33 additions & 14 deletions .github/workflows/build_and_publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,37 +77,56 @@ jobs:
- name: build
run: make build-native

- name: lint
run: make lint
# - name: lint
# run: make lint

- name: test
run: make test
# - name: test
# run: make test

- name: test docker build (no browser)
uses: grafana/shared-workflows/actions/build-push-to-dockerhub@f0dd3480fa3e657d741dd9e8d9b999cfb61fc713
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1

- name: docker metadata (no brower)
id: docker-metadata-no-browser
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1
with:
push: false
images: ${{ needs.preflight.outputs.repo_name }}
platforms: |-
${{ steps.build-info.outputs.os }}/${{ steps.build-info.outputs.arch }}
tags: |-
type=raw,value=${{ steps.version.outputs.value }}
type=sha,prefix=sha-,format=short
latest
target: release
- name: test docker build (browser)
uses: grafana/shared-workflows/actions/build-push-to-dockerhub@f0dd3480fa3e657d741dd9e8d9b999cfb61fc713
- name: test docker build (no browser)
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6.9.0
with:
push: false
tags: ${{ steps.docker-metadata-no-browser.outputs.tags }}
labels: ${{ steps.docker-metadata-no-browser.outputs.labels }}
target: release
load: true
cache-from: type=gha
# cache-to: type=gha,mode=max

- name: docker metadata (brower)
id: docker-metadata-browser
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1
with:
images: ${{ needs.preflight.outputs.repo_name }}
platforms: |-
${{ steps.build-info.outputs.os }}/${{ steps.build-info.outputs.arch }}
tags: |-
type=raw,value=${{ steps.version.outputs.value }}-browser
type=sha,prefix=sha-,suffix=-browser,format=short
latest-browser
- name: test docker build (browser)
uses: grafana/shared-workflows/actions/build-push-to-dockerhub@f0dd3480fa3e657d741dd9e8d9b999cfb61fc713
with:
push: false
tags: ${{ steps.docker-metadata-browser.outputs.tags }}
labels: ${{ steps.docker-metadata-browser.outputs.labels }}
target: with-browser
load: true
cache-from: type=gha
# cache-to: type=gha,mode=max

- name: list images
run: |
Expand Down
6 changes: 2 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ RUN apk --no-cache add ca-certificates-bundle
# Second stage copies the binaries, configuration and also the
# certificates from the first stage.

ARG TARGETPLATFORM

FROM --platform=$TARGETPLATFORM alpine:3.20.3 AS release
FROM alpine:3.20.3 AS release
ARG TARGETOS
ARG TARGETARCH
ARG HOST_DIST=$TARGETOS-$TARGETARCH
Expand All @@ -21,7 +19,7 @@ ENTRYPOINT ["/usr/local/bin/synthetic-monitoring-agent"]

# Third stage copies the setup from the base agent and
# additionally installs Chromium to support browser checks.
FROM --platform=$TARGETPLATFORM alpine:3.20.3 AS with-browser
FROM alpine:3.20.3 AS with-browser

# Renovate updates the pinned packages below.
# The --repository arg is required for renovate to know which alpine repo it should look for updates in.
Expand Down

0 comments on commit 451af09

Please sign in to comment.