Skip to content

Commit

Permalink
ci: Fix GHCR path (#15670)
Browse files Browse the repository at this point in the history
  • Loading branch information
Twixes authored May 23, 2023
1 parent 3e816cd commit 82093b6
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 8 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/ci-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,16 @@ jobs:
OBJECT_STORAGE_SECRET_ACCESS_KEY=object_storage_root_password
EOT
- name: Lowercase GITHUB_REPOSITORY
id: lowercase
run: |
echo "repository=${GITHUB_REPOSITORY,,}" >> "$GITHUB_OUTPUT"
- name: Get the PostHog container image of this PR
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository }}/posthog
images: ghcr.io/${{ steps.lowercase.outputs.repository }}/posthog

- name: Start PostHog
run: |
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/codespaces.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ jobs:
with:
fetch-depth: 1

- name: Lowercase GITHUB_REPOSITORY
id: lowercase
run: |
echo "repository=${GITHUB_REPOSITORY,,}" >> "$GITHUB_OUTPUT"
# As ghcr.io complains if the image has upper case letters, we use
# this action to ensure we get a lower case version. See
# https://github.com/docker/build-push-action/issues/237#issuecomment-848673650
Expand All @@ -39,7 +44,7 @@ jobs:
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository }}/codespaces
images: ghcr.io/${{ steps.lowercase.outputs.repository }}/codespaces
tags: |
type=ref,event=branch
type=raw,value=master
Expand All @@ -51,7 +56,7 @@ jobs:
id: meta-for-cache
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository }}/codespaces
images: ghcr.io/${{ steps.lowercase.outputs.repository }}/codespaces
tags: |
type=raw,value=master
Expand Down
14 changes: 12 additions & 2 deletions .github/workflows/container-images-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,16 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3

- name: Lowercase GITHUB_REPOSITORY
id: lowercase
run: |
echo "repository=${GITHUB_REPOSITORY,,}" >> "$GITHUB_OUTPUT"
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository }}/posthog
images: ghcr.io/${{ steps.lowercase.outputs.repository }}/posthog
tags: |
type=schedule
type=ref,event=branch
Expand Down Expand Up @@ -109,6 +114,11 @@ jobs:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Lowercase GITHUB_REPOSITORY
id: lowercase
run: |
echo "repository=${GITHUB_REPOSITORY,,}" >> "$GITHUB_OUTPUT"
- name: Build container images
id: build
uses: depot/build-push-action@v1
Expand All @@ -124,7 +134,7 @@ jobs:
# Use the non-cloud image as base image and extend it with
# the posthog-cloud code we've checked out.
build-args: |
BASE_IMAGE=ghcr.io/${{ github.repository }}/posthog:${{ needs.posthog_build.outputs.container_image_version }}
BASE_IMAGE=ghcr.io/${{ steps.lowercase.outputs.repository }}/posthog:${{ needs.posthog_build.outputs.container_image_version }}
deploy_preview:
uses: ./.github/workflows/pr-deploy.yml
Expand Down
16 changes: 13 additions & 3 deletions .github/workflows/customer-data-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,15 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Lowercase GITHUB_REPOSITORY
id: lowercase
run: |
echo "repository=${GITHUB_REPOSITORY,,}" >> "$GITHUB_OUTPUT"
- uses: docker/metadata-action@v4
id: meta
with:
images: ghcr.io/${{ github.repository }}/cdp
images: ghcr.io/${{ steps.lowercase.outputs.repository }}/cdp

# Make the image tags used for docker cache. We use this rather than
# ${{ github.repository }} directly because the repository
Expand All @@ -47,7 +52,7 @@ jobs:
- uses: docker/metadata-action@v4
id: meta-cache
with:
images: ghcr.io/${{ github.repository }}/cdp
images: ghcr.io/${{ steps.lowercase.outputs.repository }}/cdp
tags: |
type=raw,value=cache
Expand Down Expand Up @@ -128,12 +133,17 @@ jobs:
# Run the functional tests.
pnpm jest
- name: Lowercase GITHUB_REPOSITORY
id: lowercase
run: |
echo "repository=${GITHUB_REPOSITORY,,}" >> "$GITHUB_OUTPUT"
- name: Generate docker latest tag
if: github.ref == 'refs/heads/master'
uses: docker/metadata-action@v4
id: meta
with:
images: ghcr.io/${{ github.repository }}/cdp
images: ghcr.io/${{ steps.lowercase.outputs.repository }}/cdp
tags: |
type=raw,value=latest
Expand Down

0 comments on commit 82093b6

Please sign in to comment.