File tree 1 file changed +48
-0
lines changed
1 file changed +48
-0
lines changed Original file line number Diff line number Diff line change
1
+ # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2
+ # For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
3
+
4
+ name : Node.js Package
5
+ env :
6
+ REGISTRY : ghcr.io
7
+ IMAGE_NAME : ${{github.repository}}
8
+ GIT_TOKEN : ${{secrets.GIT_TOKEN}}
9
+ on :
10
+ push :
11
+ branches : ["main"]
12
+ pull_request :
13
+ branches : " *"
14
+ jobs :
15
+ # # docker publication normal
16
+ publish-docker-normal :
17
+ runs-on : ubuntu-latest
18
+ env :
19
+ GIT_TOKEN : ${{secrets.GIT_TOKEN}}
20
+ permissions :
21
+ contents : read
22
+ packages : write
23
+ if : ${{github.ref == 'refs/heads/main'}}
24
+ steps :
25
+ - name : Checkout repository
26
+ uses : actions/checkout@v3
27
+ - name : Log in to the Container registry
28
+ uses : docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
29
+ with :
30
+ registry : ${{ env.REGISTRY }}
31
+ username : ${{ github.actor }}
32
+ password : ${{ secrets.GIT_TOKEN }}
33
+ - name : Extract metadata (tags, labels) for Docker
34
+ id : meta
35
+ uses : docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
36
+ with :
37
+ images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
38
+ tags : |
39
+ type=ref,event=branch
40
+ type=sha
41
+ - run : ls -a -R .
42
+ - name : Build and push Docker image
43
+ uses : docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
44
+ with :
45
+ context : .
46
+ push : true
47
+ tags : ${{ steps.meta.outputs.tags }}
48
+ labels : ${{ steps.meta.outputs.labels }}
You can’t perform that action at this time.
0 commit comments