-
Notifications
You must be signed in to change notification settings - Fork 1
52 lines (44 loc) · 1.33 KB
/
docker-image.yml
File metadata and controls
52 lines (44 loc) · 1.33 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Docker Image CI
on:
push:
tags:
- "v*.*.*"
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
build:
runs-on: ubuntu-latest
steps:
# 1️⃣ Checkout code
- name: Checkout Repository
uses: actions/checkout@v6
# 2️⃣ Login to DockerHub
- name: Login to DockerHub
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# 3️⃣ Setup Docker Buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
# 4️⃣ Extract tag version
- name: Extract version
id: version
run: |
VERSION=${GITHUB_REF#refs/tags/}
echo "version=$VERSION" >> $GITHUB_OUTPUT
# 5️⃣ Build & Push
- name: Build & Push Docker Image
uses: docker/build-push-action@v7
with:
context: .
file: ./Dockerfile
push: true
platforms: linux/amd64
build-args: |
APP_VERSION=${{ steps.version.outputs.version }}
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/streamvision:${{ steps.version.outputs.version }}
${{ secrets.DOCKERHUB_USERNAME }}/streamvision:latest
cache-from: type=gha
cache-to: type=gha,mode=max