CI: build container
This commit is contained in:
parent
25ce207ee3
commit
68a1fecf26
2 changed files with 35 additions and 19 deletions
35
.forgejo/workflows/build.yaml
Normal file
35
.forgejo/workflows/build.yaml
Normal file
|
@ -0,0 +1,35 @@
|
|||
on:
|
||||
push:
|
||||
jobs:
|
||||
build:
|
||||
runs-on: container
|
||||
container:
|
||||
image: tiptop:5000/treetrail-backend-ci-base
|
||||
volumes:
|
||||
- "/root/.cache/uv:uv_cache"
|
||||
services:
|
||||
treetrail-database:
|
||||
image: treetrail-database
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Create venv
|
||||
run: uv venv
|
||||
- name: Install dependencies
|
||||
run: uv sync
|
||||
- name: Run basic test (bootstrap)
|
||||
run: .venv/bin/pytest -s tests/basic.py
|
||||
|
||||
- name: Build container
|
||||
uses: actions/buildah-build@v1
|
||||
with:
|
||||
image: treetrail-srv
|
||||
#tags: foo # v1 ${{ github.sha }}
|
||||
containerfiles: |
|
||||
./Containerfile
|
||||
|
||||
- uses: actions/push-to-registry@v2
|
||||
with:
|
||||
registry: "docker://${{ vars.REPOSITORY }}"
|
||||
image: treetrail-srv
|
||||
tags: latest
|
|
@ -1,19 +0,0 @@
|
|||
on: [push]
|
||||
jobs:
|
||||
install:
|
||||
runs-on: container
|
||||
container:
|
||||
image: tiptop:5000/treetrail-backend-ci-base
|
||||
volumes:
|
||||
- "/root/.cache/uv:uv_cache"
|
||||
services:
|
||||
treetrail-database:
|
||||
image: treetrail-database
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Create venv
|
||||
run: uv venv
|
||||
- name: Install dependencies
|
||||
run: uv sync
|
||||
- name: Run basic test (bootstrap)
|
||||
run: .venv/bin/pytest -s tests/basic.py
|
Loading…
Add table
Add a link
Reference in a new issue