Skip to content

Commit

Permalink
chore: auto-publish docker images
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanFlurry committed Nov 18, 2024
1 parent 497c62a commit 1ee3759
Show file tree
Hide file tree
Showing 16 changed files with 319 additions and 260 deletions.
16 changes: 16 additions & 0 deletions .github/actions/docker-setup/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: 'Docker Setup'
description: 'Set up Docker Buildx and log in to Docker Hub'
runs:
using: 'composite'
steps:
- name: Checkout code
uses: actions/checkout@v2

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

- name: Log in to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
46 changes: 0 additions & 46 deletions .github/workflows/bolt-check.yaml

This file was deleted.

50 changes: 0 additions & 50 deletions .github/workflows/bolt-test.yaml

This file was deleted.

17 changes: 0 additions & 17 deletions .github/workflows/detect-secrets.yaml

This file was deleted.

89 changes: 0 additions & 89 deletions .github/workflows/docker-publish.yaml

This file was deleted.

143 changes: 143 additions & 0 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
name: docker

on:
push:
branches:
- main
tags:
- '*'

jobs:
build-and-push-server:
runs-on: ubuntu-latest
steps:
- uses: ./.github/actions/docker-setup

- name: Metadata (rivetgg/server:full)
id: meta-full
uses: docker/metadata-action@v4
with:
images: rivetgg/rivet-server
tags: |
type=sha,prefix=full-
type=ref,event=branch,prefix=full-
type=ref,event=tag,prefix=full-
- name: Build & Push (rivetgg/server:full)
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ steps.meta-full.outputs.tags }}
file: docker/release/server.Dockerfile
target: full
platforms: linux/amd64,linux/arm64

- name: Metadata (rivetgg/server:slim)
id: meta-slim
uses: docker/metadata-action@v4
with:
images: rivetgg/rivet-server
tags: |
type=sha,prefix=slim-
type=ref,event=branch,prefix=slim-
type=ref,event=tag,prefix=slim-
- name: Build & Push (rivetgg/server:slim)
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ steps.meta-slim.outputs.tags }}
file: docker/release/server.Dockerfile
target: slim
platforms: linux/amd64,linux/arm64

build-and-push-client:
runs-on: ubuntu-latest
steps:
- uses: ./.github/actions/docker-setup

- name: Metadata (rivetgg/client:full-runner)
id: meta-full-runner
uses: docker/metadata-action@v4
with:
images: rivetgg/rivet-client
tags: |
type=sha,prefix=full-runner-
type=ref,event=branch,prefix=full-runner-
type=ref,event=tag,prefix=full-runner-
- name: Build & Push (rivetgg/client:full-runner)
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ steps.meta-full-runner.outputs.tags }}
file: docker/release/client.Dockerfile
target: full-runner
platforms: linux/amd64,linux/arm64

- name: Metadata (rivetgg/client:isolate-v8-runner)
id: meta-isolate-v8-runner
uses: docker/metadata-action@v4
with:
images: rivetgg/rivet-client
tags: |
type=sha,prefix=isolate-v8-runner-
type=ref,event=branch,prefix=isolate-v8-runner-
type=ref,event=tag,prefix=isolate-v8-runner-
- name: Build & Push (rivetgg/client:isolate-v8-runner)
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ steps.meta-isolate-v8-runner.outputs.tags }}
file: docker/release/client.Dockerfile
target: isolate-v8-runner
platforms: linux/amd64,linux/arm64

- name: Metadata (rivetgg/client:container-runner)
id: meta-container-runner
uses: docker/metadata-action@v4
with:
images: rivetgg/rivet-client
tags: |
type=sha,prefix=container-runner-
type=ref,event=branch,prefix=container-runner-
type=ref,event=tag,prefix=container-runner-
- name: Build & Push (rivetgg/client:container-runner)
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ steps.meta-container-runner.outputs.tags }}
file: docker/release/client.Dockerfile
target: container-runner
platforms: linux/amd64,linux/arm64

build-and-push-monolith:
runs-on: ubuntu-latest
steps:
- uses: ./.github/actions/docker-setup

- name: Metadata (rivetgg/rivet)
id: meta-monolith
uses: docker/metadata-action@v4
with:
images: rivetgg/rivet
tags: |
type=sha,prefix=monolith-
type=ref,event=branch,prefix=monolith-
type=ref,event=tag,prefix=monolith-
- name: Build & Push (rivetgg/rivet)
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ steps.meta-monolith.outputs.tags }}
file: docker/dev-monolith/Dockerfile
platforms: linux/amd64,linux/arm64
13 changes: 6 additions & 7 deletions .github/workflows/fern.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,12 @@ jobs:
- name: Check Fern API is valid
run: fern check

# TODO: Re-enable once https://github.com/fern-api/fern/pull/2551 is resolved
# - name: Verify generated code is up to date
# env:
# FERN_TOKEN: ${{ secrets.FERN_TOKEN }}
# run: |
# ./scripts/fern/gen.sh
# git --no-pager diff --exit-code
- name: Verify generated code is up to date
env:
FERN_TOKEN: ${{ secrets.FERN_TOKEN }}
run: |
./scripts/fern/gen.sh
git --no-pager diff --exit-code
fern-publish:
runs-on: ubuntu-20.04
Expand Down
Loading

0 comments on commit 1ee3759

Please sign in to comment.