Skip to content

Commit

Permalink
feat: port Containerfile to use Vib's recipe
Browse files Browse the repository at this point in the history
Signed-off-by: K.B.Dharun Krishna <[email protected]>
  • Loading branch information
kbdharun authored Apr 29, 2024
1 parent 673de99 commit 3e4451e
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 22 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Image
on:
push:
branches: [ "main" ]
pull_request:

env:
REGISTRY_USER: ${{ github.actor }}
Expand All @@ -14,6 +15,15 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: vanilla-os/[email protected]
with:
recipe: 'recipe.yml'

- uses: actions/upload-artifact@v4
with:
name: Containerfile
path: Containerfile

- name: Build image
run: docker image build -f Containerfile --tag ghcr.io/vanilla-os/differ:main .

Expand Down
22 changes: 0 additions & 22 deletions Containerfile

This file was deleted.

47 changes: 47 additions & 0 deletions recipe.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Differ
id: differ
stages:
- id: build
base: docker.io/golang:1.21-alpine
singlelayer: false
labels:
maintainer: Mateus Melchiades
cmd: ["/home/user/differ"]
expose:
"8080": ""
modules:
- name: init
type: shell
source:
type: git
url: https://github.com/Vanilla-OS/Differ
branch: main
commit: latest
commands:
- mkdir /home/user
- cp /sources/init/main.go /home/user/
- cp /sources/init/go.mod /home/user/
- cp /sources/init/go.sum /home/user/
- cp /sources/init/go.work /home/user/
- cp /sources/init/Makefile /home/user/
- mv /sources/init/core /home/user/core/
- mv /sources/init/diff /home/user/diff/
- mv /sources/init/types /home/user/types/
- mv /sources/init/vendor /home/user/vendor/
- rm -rf /sources/init

- name: install-deps
type: shell
commands:
- apk add gcc musl-dev sqlite make

- name: build
type: shell
commands:
- cd /home/user
- make

- name: cleanup
type: shell
commands:
- rm -rf main.go go.mod go.sum go.work Makefile core/ types/ vendor/

0 comments on commit 3e4451e

Please sign in to comment.