Skip to content

Commit c09f564

Browse files
committed
Feature: build and release docker image
1 parent c4a7b20 commit c09f564

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Build and Release Docker Image
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout repo
12+
uses: actions/checkout@v3
13+
14+
- name: Set up docker Buildx
15+
uses: docker/setup-buildx-action@v2
16+
17+
- name: Docker-hub account login
18+
uses: docker/login-action@v2
19+
with:
20+
username: ${{ secrets.DOCKER_USERNAME }}
21+
password: ${{ secrets.DOCKER_PASSWORD }}
22+
23+
- name: Extract release tag
24+
id: meta
25+
run: echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
26+
27+
- name: Build and push Docker image
28+
uses: docker/build-push-action@v3
29+
with:
30+
context: .
31+
file: Dockerfile
32+
push: true
33+
tags: |
34+
${{ secrets.DOCKER_USERNAME }}/nexumdb:latest
35+
${{ secrets.DOCKER_USERNAME }}/nexumdb:${{ steps.meta.outputs.version }}
36+
${{ secrets.DOCKER_USERNAME }}/nexumdb:${{ github.sha }}
37+
cache-from: type=registry,ref=${{ secrets.DOCKER_USERNAME }}/nexumdb:buildcache
38+
cache-to: type=registry,ref=${{ secrets.DOCKER_USERNAME }}/nexumdb:buildcache,mode=max

0 commit comments

Comments
 (0)