-
-
Notifications
You must be signed in to change notification settings - Fork 2
46 lines (42 loc) · 1.13 KB
/
docker.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Docker
on:
pull_request:
push:
branches:
- '*'
tags:
- '*'
env:
CARGO_TERM_COLOR: always
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install docker for macos
if: startsWith(matrix.os, 'macos-')
uses: douglascamata/setup-docker-macos-action@v1-alpha
- name: Databases
run: docker compose up -d
- name: Run tests
run: cargo test --verbose
build-and-releas:
name: build and release docker
needs: [test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build
run: docker build -t ghcr.io/${{ github.repository }}/geni:${{ github.ref_name }} .
- name: Push
if: startsWith(github.ref, 'refs/tags/')
run: docker push ghcr.io/${{ github.repository }}:${{ github.ref_name }}