Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 15 additions & 62 deletions .github/workflows/publish-dashboard.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish Dashboard image to GHCR
name: Publish Dashboard Image

on:
push:
Expand All @@ -9,99 +9,52 @@ on:
types: [published]
workflow_dispatch:

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository_owner }}/exosphere-dashboard
SHA_TAG: ${{ github.sha }}

jobs:
publish-image-on-ghcr:
build-and-publish:
runs-on: ubuntu-latest
if: github.repository == 'exospherehost/exospherehost'

permissions:
contents: read
packages: write

outputs:
tags: ${{ steps.meta.outputs.tags }}
json: ${{ steps.meta.outputs.json }}

steps:
- uses: actions/checkout@v4
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: arm64

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

- name: Log in to GHCR
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Generate tags & labels
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=beta-latest
type=sha,format=short

- name: Build and push
uses: docker/build-push-action@v5
with:
context: ./dashboard
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
provenance: true
sbom: true

publish-image-on-docker:
runs-on: ubuntu-latest
if: github.repository == 'exospherehost/exospherehost'

permissions:
contents: read
packages: write

outputs:
tags: ${{ steps.meta.outputs.tags }}
json: ${{ steps.meta.outputs.json }}

steps:
- uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: arm64

- uses: docker/setup-buildx-action@v3

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Generate tags & labels
- name: Generate tags & labels for both registries
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE_NAME }}
images: |
ghcr.io/exospherehost/exosphere-dashboard
exospherehost/exosphere-dashboard
tags: |
type=raw,value=beta-latest
type=raw,value=latest
type=sha,format=short

- name: Build and push
- name: Build and push to both registries
uses: docker/build-push-action@v5
with:
context: ./dashboard
Expand All @@ -110,4 +63,4 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
provenance: true
sbom: true
sbom: true
101 changes: 101 additions & 0 deletions .github/workflows/publish-state-manager.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: Publish State Manager Image

on:
push:
branches: [main]
paths:
- 'state-manager/**'
workflow_dispatch:

jobs:
test:
runs-on: ubuntu-latest
services:
mongodb:
image: mongo:7
ports:
- 27017:27017
options: >-
--health-cmd "mongosh --eval 'db.runCommand(\"ping\")'"
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
MONGO_INITDB_ROOT_USERNAME: admin
MONGO_INITDB_ROOT_PASSWORD: password
MONGO_INITDB_DATABASE: test_db

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: state-manager/go.mod

- name: Run test suite
working-directory: state-manager
env:
MONGO_URI: mongodb://admin:password@localhost:27017/?authSource=admin
MONGO_DATABASE_NAME: test_exosphere_state_manager
STATE_MANAGER_SECRET: test-secret-key
SECRETS_ENCRYPTION_KEY: ${{ secrets.STATE_MANAGER_ENCRYPTION_KEY }}
run: |
go test -v ./...

publish:
runs-on: ubuntu-latest
needs: test
if: github.repository == 'exospherehost/exospherehost'

permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: arm64

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

- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Generate tags & labels for both registries
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/exospherehost/exosphere-state-manager
exospherehost/exosphere-state-manager
tags: |
type=raw,value=latest
type=sha,format=short

- name: Build and push to both registries
uses: docker/build-push-action@v5
with:
context: ./state-manager
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
provenance: true
sbom: true
169 changes: 0 additions & 169 deletions .github/workflows/publish-state-mangaer.yml

This file was deleted.

Loading