-
Notifications
You must be signed in to change notification settings - Fork 25
51 lines (41 loc) · 1.17 KB
/
ci.yml
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
47
48
49
50
51
name: Continuous Integration
on:
push:
branches: [ main ]
tags: [ '*' ]
pull_request:
jobs:
test:
name: Run test suite
runs-on: ubuntu-latest
env:
DOCKER_USER: ${{ secrets.DOCKER_USER }}
DOCKER_PASS: ${{ secrets.DOCKER_PASS }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Login to DockerHub
run: echo $DOCKER_PASS | docker login --username $DOCKER_USER --password-stdin
- name: Build docker images
run: make build
- name: Boot development environment
run: make env-up
- name: Run tests
run: make test
release:
needs: test
if: ${{ startsWith(github.ref, 'refs/heads/') || startsWith(github.ref, 'refs/tags/') }}
name: Push to DockerHub
runs-on: ubuntu-latest
env:
DOCKER_USER: ${{ secrets.DOCKER_USER }}
DOCKER_PASS: ${{ secrets.DOCKER_PASS }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Login to DockerHub
run: docker login -u $DOCKER_USER -p $DOCKER_PASS
- name: Release
run: ./scripts/release.sh
env:
VERSION: ${{ github.ref_name == 'main' && 'latest' || github.ref_name }}