Skip to content

Commit

Permalink
fix(ci): docker builds
Browse files Browse the repository at this point in the history
  • Loading branch information
jkroepke committed Nov 3, 2022
1 parent 646c3ac commit 99cc21c
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 39 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,41 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
-
name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Set up Docker Build Metadata
id: docker_meta
uses: docker/metadata-action@v4
with:
images: jkroepke/github_exporter
flavor: |
latest=${{ !contains(github.ref_name, 'rc') }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,event=tag,pattern={{version}}
type=raw,event=tag,value=latest,enable=${{ !contains(github.ref_name, 'rc') }}
labels: |
maintainer=jkroepke
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
pull: ${{ startsWith(github.ref, 'refs/tags/v') }}
push: ${{ startsWith(github.ref, 'refs/tags/v') }}
platforms: linux/amd64${{ startsWith(github.ref, 'refs/tags/v') && ',linux/arm64' || '' }}
labels: ${{ steps.docker_meta.outputs.labels }}
tags: ${{ steps.docker_meta.outputs.tags }}
26 changes: 0 additions & 26 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,31 +1,5 @@
FROM node:lts-alpine

ARG VERSION=unknown
ARG VCS_REF=unknown
ARG BUILD_DATE=unknown

# https://github.com/opencontainers/image-spec/blob/master/annotations.md#pre-defined-annotation-keys
LABEL name="jkroepke/github_exporter" \
maintainer="Jan-Otto Kröpke <github@jkroepke.de>" \
description="Export various metrics including insights about github repositories" \
url="https://github.com/jkroepke/github_exporter" \
org.opencontainers.image.created="${BUILD_DATE}" \
org.opencontainers.image.authors="Jan-Otto Kröpke <github@jkroepke.de>" \
org.opencontainers.image.url="https://github.com/jkroepke/github_exporter" \
org.opencontainers.image.version="${VERSION}" \
org.opencontainers.image.source="https://github.com/jkroepke/github_exporter" \
org.opencontainers.image.revision="${VCS_REF}" \
org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.title="jkroepke/github_exporter" \
org.opencontainers.image.description="Export various metrics including insights about github repositories" \
org.label-schema.build-date="${BUILD_DATE}" \
org.label-schema.version="${VERSION}" \
org.label-schema.vcs-url="https://github.com/jkroepke/github_exporter" \
org.label-schema.vcs-ref="${VCS_REF}" \
org.label-schema.license="MIT" \
org.label-schema.name="jkroepke/github_exporter" \
org.label-schema.description="Export various metrics including insights about github repositories"

EXPOSE 9171

ENV NODE_ENV=production HUSKY=0
Expand Down
13 changes: 0 additions & 13 deletions hooks/build

This file was deleted.

0 comments on commit 99cc21c

Please sign in to comment.