@gaias/basenode 0.0.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
name: Base Node CI
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
branches: ["main"]
|
|
5
|
+
tags:
|
|
6
|
+
- "v*"
|
|
7
|
+
pull_request:
|
|
8
|
+
branches: ["main"]
|
|
9
|
+
jobs:
|
|
10
|
+
build:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- name: Project CICD Start
|
|
14
|
+
id: date
|
|
15
|
+
run: echo "::set-output name=date::$(TZ=Asia/Singapore date +'%Y%m%d%H%M%S')"
|
|
16
|
+
|
|
17
|
+
- name: Clone Github Repository
|
|
18
|
+
uses: actions/checkout@v3
|
|
19
|
+
|
|
20
|
+
- name: Current Version From Package.json
|
|
21
|
+
id: package-version
|
|
22
|
+
uses: martinbeentjes/npm-get-version-action@main
|
|
23
|
+
# run: echo "Current Version " +${{ steps.package-version.outputs.current-version}}
|
|
24
|
+
# - name: Docker Extract metadata from Git reference and GitHub events
|
|
25
|
+
# id: meta
|
|
26
|
+
# uses: docker/metadata-action@v4
|
|
27
|
+
# with:
|
|
28
|
+
# images: yxj1985/base_node
|
|
29
|
+
|
|
30
|
+
- name: Set Up QEMU
|
|
31
|
+
uses: docker/setup-qemu-action@v1
|
|
32
|
+
|
|
33
|
+
- name: SetUp Docker build
|
|
34
|
+
id: build
|
|
35
|
+
uses: docker/setup-buildx-action@v1
|
|
36
|
+
|
|
37
|
+
- name: Available Platforms
|
|
38
|
+
run: echo ${{ steps.build.outputs.platforms }}
|
|
39
|
+
|
|
40
|
+
- name: Login To DockerHub
|
|
41
|
+
uses: docker/login-action@v1
|
|
42
|
+
with:
|
|
43
|
+
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
|
44
|
+
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
|
|
45
|
+
|
|
46
|
+
- name: Build And Push Image to Docker Hub
|
|
47
|
+
uses: docker/build-push-action@v2
|
|
48
|
+
with:
|
|
49
|
+
context: .
|
|
50
|
+
file: ./Dockerfile
|
|
51
|
+
# List of target platforms for build eg: linux/amd64,linux/arm64,linux/arm/v7
|
|
52
|
+
platforms: linux/amd64,linux/arm64/v8
|
|
53
|
+
# push image to docker hub
|
|
54
|
+
push: ${{ github.event_name != 'pull_request' }}
|
|
55
|
+
# Add multiple Tags
|
|
56
|
+
# latest version: yxj1985/${{ github.event.repository.name }}:latest
|
|
57
|
+
# package version: yxj1985/${{ github.event.repository.name }}:v${{ steps.package-version.outputs.current-version}}
|
|
58
|
+
# timestampe version: yxj1985/${{ github.event.repository.name }}:${{ steps.date.outputs.date }}
|
|
59
|
+
tags: |
|
|
60
|
+
yxj1985/${{ github.event.repository.name }}:latest
|
|
61
|
+
yxj1985/${{ github.event.repository.name }}:v${{ steps.package-version.outputs.current-version}}
|
|
62
|
+
yxj1985/${{ github.event.repository.name }}:v${{ steps.date.outputs.date }}
|
|
63
|
+
|
|
64
|
+
# docker/metadata-action@v4 meta (tags labels) from Git reference and GitHub events
|
|
65
|
+
# tags: ${{ steps.meta.outputs.tags }}
|
|
66
|
+
# labels: ${{ steps.meta.outputs.labels }}
|
|
67
|
+
|
|
68
|
+
- name: Project Image Build And Push Successfully
|
|
69
|
+
run: echo Current Version v${{ steps.package-version.outputs.current-version}} Successfully!!
|