-
Notifications
You must be signed in to change notification settings - Fork 1
43 lines (36 loc) · 1.09 KB
/
dev-build-push.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
name: dev docker build & push
on:
push:
branches:
- dev
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Extract Git info
run: |
echo "GIT_COMMITID=$(git rev-parse HEAD)" >> $GITHUB_ENV
echo "GIT_BRANCH=$(git symbolic-ref --short HEAD)" >> $GITHUB_ENV
- name: Login to Docker registry
uses: docker/login-action@v3
with:
registry: registry.zec.one
username: ${{ secrets.REGISTRY_ZEC_ONE_USERNAME }}
password: ${{ secrets.REGISTRY_ZEC_ONE_PASSWORD }}
- name: Set up Docker Buildx
run: |
docker buildx version
docker buildx create --use
- name: Dockerize and Push Image
uses: docker/build-push-action@v5
with:
push: true
platforms: linux/arm64,linux/amd64
tags: registry.zec.one/charge-controller-dev
build-args: |
GIT_COMMITID=${{ env.GIT_COMMITID }}
GIT_BRANCH=${{ env.GIT_BRANCH }}