-
Notifications
You must be signed in to change notification settings - Fork 1
77 lines (64 loc) · 2.18 KB
/
build.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Build flAPI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Checkout submodule
uses: actions/checkout@v3
with:
repository: duckdb/duckdb
path: duckdb
ref: v1.1.2
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake ninja-build
- name: Cache vcpkg
uses: actions/cache@v3
with:
path: |
~/.cache/vcpkg
./vcpkg/installed
key: ${{ runner.os }}-vcpkg-${{ hashFiles('vcpkg.json') }}
- name: Configure vcpkg
run: |
./vcpkg/bootstrap-vcpkg.sh
./vcpkg/vcpkg integrate install
- name: Build Release
run: make release
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: flAPI-build
path: ${{github.workspace}}/build/release/flapi
if-no-files-found: error
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Lowercase github.repository_owner
run: |
echo "REPOSITORY_OWNER=`echo ${{github.repository_owner}} | tr '[:upper:]' '[:lower:]'`" >>${GITHUB_ENV}
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
file: ./docker/development/Dockerfile
push: true
tags: |
${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && format('ghcr.io/{0}/flapi:latest', env.REPOSITORY_OWNER) || '' }}
${{ github.event_name == 'push' && format('ghcr.io/{0}/flapi:branch-{1}', env.REPOSITORY_OWNER, github.ref_name) || '' }}
${{ github.event_name == 'pull_request' && format('ghcr.io/{0}/flapi:pr-{1}', env.REPOSITORY_OWNER, github.event.number) || '' }}
ghcr.io/${{ env.REPOSITORY_OWNER }}/flapi:${{ github.sha }}