-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (34 loc) · 1.22 KB
/
docker.yaml
File metadata and controls
36 lines (34 loc) · 1.22 KB
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
name: "Build and Push Docker Image"
on:
push:
branches:
- main
paths:
- 'include/expresso/version.h'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: "jadit19"
password: ${{ secrets.DOCKER_TOKEN }}
- name: Extract version
id: extract_version
run: |
MAJOR_VERSION=$(grep -oP '(?<=#define EXPRESSO_VERSION_MAJOR )\d+' include/expresso/version.h)
MINOR_VERSION=$(grep -oP '(?<=#define EXPRESSO_VERSION_MINOR )\d+' include/expresso/version.h)
PATCH_VERSION=$(grep -oP '(?<=#define EXPRESSO_VERSION_PATCH )\d+' include/expresso/version.h)
echo "VERSION=$MAJOR_VERSION.$MINOR_VERSION.$PATCH_VERSION" >> $GITHUB_ENV
- name: Build and push
run: |
docker buildx build --platform linux/amd64,linux/arm/v7 -t jadit19/expresso:latest -t jadit19/expresso:${{ env.VERSION }} -f docker/build.dockerfile --push .