-
Notifications
You must be signed in to change notification settings - Fork 70
executable file
·45 lines (36 loc) · 1.23 KB
/
dockerhub-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
name: Dockerhub Image CI
on:
push:
branches: [ dev ]
workflow_dispatch: null
# Ensures only the latest workflow run for the same branch is active, canceling any in-progress runs.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
release:
name: Build Docker image and push to DockerHub
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Log in to Dockerhub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Get release version
run: echo "COMPAS_VERSION=$(sed -n '/const std::string VERSION_STRING/,/^$/p' ./src/changelog.h | sed 's/.*"\(.*\)"[^"]*$/\1/')" >> $GITHUB_ENV
- name: Print version
run: echo $COMPAS_VERSION
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
teamcompas/compas:${{ env.COMPAS_VERSION }}
teamcompas/compas:latest
cache-from: type=gha
cache-to: type=gha,mode=max