File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Build Docker Image
2
+
3
+ on : [push, pull_request, release]
4
+
5
+ jobs :
6
+ main :
7
+ runs-on : ubuntu-20.04
8
+ steps :
9
+ - uses : actions/checkout@v2
10
+
11
+ - name : Cache node modules
12
+ uses : actions/cache@v2
13
+ with :
14
+ path : |
15
+ ~/.npm
16
+ key : ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
17
+ restore-keys : |
18
+ ${{ runner.os }}-node-
19
+
20
+ - name : Build Docker image
21
+ run : |
22
+ docker build -t cfreak/homepage-docs:latest .
23
+
24
+ - name : Before Deploy
25
+ if : github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags')
26
+ run : |
27
+ docker logout
28
+ docker login -u "${{ secrets.DOCKER_USERNAME }}" -p "${{ secrets.DOCKER_PASSWORD }}"
29
+
30
+ - name : Deploy master branch as latest
31
+ if : github.ref == 'refs/heads/master'
32
+ run : |
33
+ docker push cfreak/homepage-docs:latest
You can’t perform that action at this time.
0 commit comments