-
Notifications
You must be signed in to change notification settings - Fork 82
33 lines (27 loc) · 903 Bytes
/
build-image.yaml
File metadata and controls
33 lines (27 loc) · 903 Bytes
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
name: Build Docker Image
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: checkout submodule
run: git submodule update --init --recursive
- name: Login to Hub
uses: docker/login-action@v3
with:
registry: ${{ secrets.DOCKERHUB_REGISTRY }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Get version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Build and Push
run: |
VERSION=${{ steps.get_version.outputs.VERSION }}
docker build -t ${{ secrets.DOCKER_IMAGE }}:${VERSION:1} .
docker push ${{ secrets.DOCKER_IMAGE }}:${VERSION:1}