Skip to content

Commit

Permalink
refactor: first run-up of docker for runtime (#135)
Browse files Browse the repository at this point in the history
Provide a docker container for homestar (first run), plus other
refactoring around builds.
  • Loading branch information
Zeeshan Lakhani committed Jun 1, 2023
1 parent 55ddb91 commit 725a863
Show file tree
Hide file tree
Showing 25 changed files with 249 additions and 330 deletions.
11 changes: 6 additions & 5 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

!**/Cargo.toml
!**/Cargo.lock

# only include runtime binary
homestar-core
homestar-guest-wasm
homestar-wasm
!**/src
!**/config
!**/migrations
!.env
!diesel.toml
!**/wits
25 changes: 5 additions & 20 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
name: 🐳 Docker

on:
push:
branches: [ main ]

pull_request:
branches: [ '**' ]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
schedule:
- cron: '0 0 * * *'

jobs:
build-docker:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' }}

env:
DOCKER_BUILDKIT: 1
Expand All @@ -33,21 +25,14 @@ jobs:
with:
buildkitd-flags: "--debug"

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Docker Build
uses: docker/build-push-action@v4
with:
cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/homestar:latest
cache-to: type=registry,ref=ghcr.io/${{ github.repository_owner }}/homestar:latest,mode=max
cache-from: type=gha
cache-to: type=gha,mode=max
file: docker/Dockerfile
context: .
platforms: linux/amd64, linux/arm64
platforms: linux/amd64
push: false
tags: |
${{ github.repository_owner }}/homestar:latest
Loading

0 comments on commit 725a863

Please sign in to comment.