Skip to content

Commit

Permalink
Revert "[CI] Build PR images on GHCR (#3432)" (#3441)
Browse files Browse the repository at this point in the history
This reverts commit b65b3f3.
  • Loading branch information
JakobLichterfeld committed Feb 9, 2024
1 parent af2ba59 commit 7ddf24f
Show file tree
Hide file tree
Showing 10 changed files with 94 additions and 307 deletions.
70 changes: 0 additions & 70 deletions .github/actions/build/action.yaml

This file was deleted.

37 changes: 0 additions & 37 deletions .github/actions/grafana/action.yml

This file was deleted.

40 changes: 0 additions & 40 deletions .github/actions/merge/action.yml

This file was deleted.

106 changes: 86 additions & 20 deletions .github/workflows/buildx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,52 +31,118 @@ jobs:
cache_id: arm64

runs-on: ${{ matrix.runs_on }}
timeout-minutes: 10

steps:
- name: Checkout
uses: actions/checkout@v4
- name: Buildx
uses: ./.github/actions/build
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
docker_password: ${{ secrets.DOCKER_PASSWORD }}
repository_owner: ${{ github.repository_owner }}
repository: ${{ github.repository }}
github_token: ${{ secrets.GITHUB_TOKEN }}
images: ${{ env.REGISTRY_IMAGE }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/[email protected]
with:
username: teslamate
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to GitHub Container Registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push by digest
id: build
uses: docker/[email protected]
with:
context: .
platforms: ${{ matrix.platform }}
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.docker_meta.outputs.tags }}
cache-from: type=registry,ref=ghcr.io/teslamate-org/teslamate:buildcache-${{ matrix.cache_id }}
cache-to: type=registry,ref=ghcr.io/teslamate-org/teslamate:buildcache-${{ matrix.cache_id }},mode=max
outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true
- name: Export digest
run: |
mkdir -p /tmp/digests
digest="${{ steps.build.outputs.digest }}"
touch "/tmp/digests/${digest#sha256:}"
- name: Upload digest
uses: actions/upload-artifact@v3
with:
name: digests
path: /tmp/digests/*
if-no-files-found: error
retention-days: 1

teslamate_merge:
runs-on: ubuntu-latest
needs:
- teslamate_build
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Login to Docker Hub
uses: docker/[email protected]
- name: Download digests
uses: actions/download-artifact@v3
with:
username: teslamate
password: ${{ secrets.DOCKER_PASSWORD }}

- uses: ./.github/actions/merge
name: digests
path: /tmp/digests
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
image: ${{ env.REGISTRY_IMAGE }}
images: ${{ env.REGISTRY_IMAGE }}
tags: |
type=schedule,pattern=edge
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=edge
- name: Login to Docker Hub
uses: docker/[email protected]
with:
username: teslamate
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Create manifest list and push
working-directory: /tmp/digests
run: |
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
- name: Inspect image
run: |
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}
grafana:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4

- uses: ./.github/actions/grafana
- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v5
with:
images: teslamate/grafana
tags: |
type=edge
type=schedule,pattern=edge
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/[email protected]
with:
username: teslamate
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push
uses: docker/[email protected]
with:
context: grafana
push: true
platforms: linux/amd64,linux/arm/v7,linux/arm64
tags: ${{ steps.docker_meta.outputs.tags }}
cache-from: type=gha
cache-to: type=gha,mode=max
10 changes: 2 additions & 8 deletions .github/workflows/elixir.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,8 @@ name: Elixir CI

on:
push:
paths:
- "**/*"
- "!.github/**" # Important: Exclude PRs related to .github from auto-run
pull_request:
branches: ["master"]
paths:
- "**/*"
- "!.github/**" # Important: Exclude PRs related to .github from auto-run
branches: [ "master" ]

jobs:
lint:
Expand Down Expand Up @@ -130,7 +124,7 @@ jobs:
services:
db:
image: postgres:15
ports: ["5432:5432"]
ports: [ "5432:5432" ]
env:
POSTGRES_PASSWORD: postgres
options: >-
Expand Down
Loading

0 comments on commit 7ddf24f

Please sign in to comment.