File tree Expand file tree Collapse file tree 5 files changed +62
-61
lines changed Expand file tree Collapse file tree 5 files changed +62
-61
lines changed Original file line number Diff line number Diff line change @@ -14,24 +14,28 @@ jobs:
14
14
with :
15
15
fetch-depth : 0
16
16
17
- - name : Install werf
18
- uses : werf/actions/install@v1.2
19
-
20
17
- name : Log in to registry
21
18
# This is where you will update the personal access token to GITHUB_TOKEN
22
19
run : echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
23
20
24
- - name : Run echo
25
- run : |
26
- werf version
27
- docker version
28
- echo $GITHUB_REPOSITORY
29
- echo $GITHUB_SHA
30
- - name : Run Build
21
+ - name : Cache layers
22
+ uses : actions/cache@v3
23
+ with :
24
+ path : " ${{ github.workspace }}/.skaffold/cache"
25
+ key : skaffold-${{ hashFiles('**/cache') }}
26
+ restore-keys : |
27
+ skaffold-
28
+
29
+ - name : Set up environment variables
31
30
run : |
32
- . $(werf ci-env github --as-file)
33
31
echo "${{ secrets.STAGE_ENV }}" > .env.deploy
34
- werf export web --tag ghcr.io/$GITHUB_REPOSITORY:$GITHUB_SHA --dev
32
+
33
+ - name : Run Skaffold pipeline as command
34
+ uses : hiberbee/github-action-skaffold@1.27.0
35
+ id : build
36
+ with :
37
+ command : build --tag ${{ github.sha }}
38
+ repository : ghcr.io/${{ github.repository_owner }}
35
39
36
40
stage-deploy :
37
41
name : Deploy on stage
Original file line number Diff line number Diff line change @@ -14,24 +14,29 @@ jobs:
14
14
with :
15
15
fetch-depth : 0
16
16
17
- - name : Install werf
18
- uses : werf/actions/install@v1.2
19
-
20
17
- name : Log in to registry
21
18
# This is where you will update the personal access token to GITHUB_TOKEN
22
19
run : echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
23
20
24
- - name : Run echo
25
- run : |
26
- werf version
27
- docker version
28
- echo $GITHUB_REPOSITORY
29
- echo $GITHUB_REF_NAME
30
- - name : Run Build
21
+ - name : Cache layers
22
+ uses : actions/cache@v3
23
+ with :
24
+ path : " ${{ github.workspace }}/.skaffold/cache"
25
+ key : skaffold-${{ hashFiles('**/cache') }}
26
+ restore-keys : |
27
+ skaffold-
28
+
29
+ - name : Set up environment variables
31
30
run : |
32
- . $(werf ci-env github --as-file)
33
31
echo "${{ secrets.PROD_ENV }}" > .env.deploy
34
- werf export web --tag ghcr.io/$GITHUB_REPOSITORY:$GITHUB_REF_NAME --dev
32
+
33
+ - name : Run Skaffold pipeline as command
34
+ uses : hiberbee/github-action-skaffold@1.27.0
35
+ id : build
36
+ with :
37
+ command : build --tag ${{ github.ref_name }}
38
+ repository : ghcr.io/${{ github.repository_owner }}
39
+
35
40
prod-deploy :
36
41
name : Deploy on prod
37
42
needs : converge
Original file line number Diff line number Diff line change
1
+ FROM node:18-alpine AS builder
2
+
3
+ WORKDIR /app
4
+
5
+ COPY package.json package-lock.json ./
6
+ COPY .env.deploy .env
7
+
8
+ RUN npm install
9
+
10
+ COPY . .
11
+
12
+ RUN npm run build
13
+
14
+ FROM nginx:alpine AS web
15
+
16
+ COPY nginx.conf /etc/nginx/nginx.conf
17
+
18
+ COPY --from=builder /app/build /usr/share/nginx/html
19
+
20
+ # Expose port 80
21
+ EXPOSE 80
22
+
23
+ # Start Nginx
24
+ CMD ["nginx" , "-g" , "daemon off;" ]
Original file line number Diff line number Diff line change
1
+ apiVersion : skaffold/v2beta28
2
+ kind : Config
3
+ build :
4
+ artifacts :
5
+ - image : docs
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments