Skip to content

Commit

Permalink
lets try getting all the variables in without copying .git
Browse files Browse the repository at this point in the history
  • Loading branch information
halkeye committed Mar 31, 2024
1 parent 9afcfe9 commit 34e03ad
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
12 changes: 12 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ permissions:
packages: write

env:

# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
Expand All @@ -29,6 +30,13 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- run: |
echo "GIT_REVISION=$(git rev-parse --short HEAD)" >> "$GITHUB_ENV"
echo "GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD)" >> "$GITHUB_ENV"
echo "VERSION=$(shell ./tools/image-tag | cut -d, -f 1)" >> "$GITHUB_ENV"
- name: Login to GHCR
uses: docker/login-action@v3
Expand All @@ -52,6 +60,10 @@ jobs:
id: build-and-push
uses: docker/build-push-action@v5
with:
build-args: |
GIT_REVISION=${{ env.GIT_REVISION }}
GIT_BRANCH=${{ env.GIT_BRANCH }}
VERSION=${{ env.VERISON }
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }} # Don't push on PR
tags: ${{ steps.meta.outputs.tags }}
Expand Down
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ ARG TARGETPLATFORM
ARG BUILDPLATFORM
ARG TARGETOS
ARG TARGETARCH
ARG GIT_BRANCH
ARG GIT_REVISION
ARG VERSION

WORKDIR /workspace
COPY .git .git
COPY . .

RUN make -n prometheus-plex-exporter GOOS=${TARGETOS} GOARCH=${TARGETARCH} BINARY=./bin/prometheus-plex-exporter
Expand Down

0 comments on commit 34e03ad

Please sign in to comment.