File tree Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Push docker image to docker hub
2
+
3
+ on :
4
+ release :
5
+ types : [created]
6
+ workflow_dispatch :
7
+
8
+ jobs :
9
+ build-and-push :
10
+ runs-on : ubuntu-latest
11
+
12
+ steps :
13
+ - name : Get code access
14
+ uses : actions/checkout@v3
15
+
16
+ - name : Extract version number
17
+ id : extract_version
18
+ run : |
19
+ VERSION=$(git describe --tags --abbrev=0)
20
+ echo "RELEASE_VERSION=${VERSION}" >> $GITHUB_ENV
21
+
22
+ - name : Log in to Docker Hub
23
+ uses : docker/login-action@v2
24
+ with :
25
+ username : ${{ secrets.DOCKER_USERNAME }}
26
+ password : ${{ secrets.DOCKER_PASSWORD }}
27
+
28
+ - name : Build Docker image
29
+ run : |
30
+ docker build -t ${{ secrets.DOCKER_USERNAME }}/f1-api-node:${{ env.RELEASE_VERSION }} .
31
+
32
+ - name : Push Docker image
33
+ run : |
34
+ docker push ${{ secrets.DOCKER_USERNAME }}/f1-api-node:${{ env.RELEASE_VERSION }}
35
+
Original file line number Diff line number Diff line change @@ -11,15 +11,19 @@ jobs:
11
11
steps :
12
12
- name : Get code access
13
13
uses : actions/checkout@v3
14
+
14
15
- name : Setup node environment
15
16
uses : actions/setup-node@v3
16
17
with :
17
18
node-version : 16
18
19
registry-url : https://registry.npmjs.org/
20
+
19
21
- name : Install dependencies
20
22
run : npm ci
23
+
21
24
- name : Build Package
22
25
run : npm run build
26
+
23
27
- name : Publish package
24
28
run : npm publish
25
29
env :
You can’t perform that action at this time.
0 commit comments