-
Notifications
You must be signed in to change notification settings - Fork 50
61 lines (57 loc) · 1.76 KB
/
ubuntu.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
name: Linux
on:
push:
branches: [ "main", "dev" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04]
steps:
- name: Installation
run: |
sudo apt-get update
sudo apt-get install -y libgl1-mesa-dev libglu1-mesa-dev p7zip gobjc g++-13 wget
g++-13 -v
export CXX=g++-13
export CC=gcc-13
wget https://github.com/xmake-io/xmake/releases/download/v2.8.1/xmake-v2.8.1.xz.run
chmod 777 xmake-v2.8.1.xz.run > a.txt
./xmake-v2.8.1.xz.run
export XMAKE_ROOT="y"
source ~/.xmake/profile
xmake --version
- name: checkout
uses: actions/checkout@v3
- name: build
run: |
export XMAKE_ROOT="y"
source ~/.xmake/profile
g++-13 -v
export CXX=g++-13
export CC=gcc-13
xmake build -y
xmake install -o .
ldd ./bin/cpp-freegpt-webui
- name: Docker login
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build the Docker image
if: ${{github.ref == 'refs/heads/dev'}}
run: |
docker build . -t ${{ secrets.DOCKERHUB_USERNAME }}/freegpt:dev
- name: Build the Docker image
if: ${{github.ref == 'refs/heads/main'}}
run: |
docker build . -t ${{ secrets.DOCKERHUB_USERNAME }}/freegpt:latest
- name: Docker image push to dev
if: ${{github.ref == 'refs/heads/dev'}}
run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/freegpt:dev
- name: Docker image push main
if: ${{github.ref == 'refs/heads/main'}}
run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/freegpt:latest