Skip to content

Commit c31f17b

Browse files
committed
fixing cicd
1 parent 68bb8dc commit c31f17b

File tree

10 files changed

+25
-174
lines changed

10 files changed

+25
-174
lines changed

.github/workflows/main.yaml

+14-9
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ on: [push, pull_request]
33

44
env:
55
app_image: hobbyfarm/admin-ui
6-
sdk_image: hobbyfarm/admin-ui-sdk
7-
dockerfile: cicd/docker/Dockerfile
86

97
should_push_image: |-
108
${{
@@ -29,14 +27,21 @@ jobs:
2927
- name: Checkout
3028
uses: actions/checkout@master
3129

30+
- name: Setup npm cache
31+
uses: actions/setup-node@v3
32+
with:
33+
node-version: 16
34+
cache: 'npm'
35+
36+
- name: Install deps
37+
run: npm install
38+
3239
- name: Build
33-
run: |
34-
docker build -f $dockerfile --tag $sdk_image --target sdk .
40+
run: npm run build:prod
3541

36-
- name: Build Release
37-
if: fromJSON(env.should_push_image)
42+
- name: Build
3843
run: |
39-
docker build -f $dockerfile --tag $app_image .
44+
docker build -f cicd/Dockerfile -t $app_image:${GIT_COMMIT_SHORT_HASH:-dev}
4045
4146
- name: Docker Login
4247
if: fromJSON(env.should_push_image)
@@ -50,9 +55,9 @@ jobs:
5055
safe_ref=$(echo "${{ github.ref_name }}" | sed -e 's/[^a-zA-Z0-9\-\.]/-/g')
5156
publish_tag=$app_image:$safe_ref
5257
53-
docker tag $app_image $publish_tag
58+
docker tag $app_image:${GIT_COMMIT_SHORT_HASH:-dev} $publish_tag
5459
docker push $publish_tag
5560
5661
- name: Docker Push Latest
5762
if: fromJSON(env.should_tag_latest)
58-
run: docker push $app_image
63+
run: docker push $app_image:latest
File renamed without changes.

cicd/Dockerfile

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Should only be used with GitHub Actions cicd
2+
# For local, refer to Dockerfile at root of project
3+
4+
FROM nginx:stable-alpine
5+
6+
COPY dist/* /usr/share/nginx/html
7+
8+
# copy staged files
9+
COPY cicd/docker/stage-release/ /
10+
11+
ENTRYPOINT ["entrypoint.sh"]

cicd/docker-local/Dockerfile

-26
This file was deleted.

cicd/docker-local/stage/etc/fixuid/config.yml

-6
This file was deleted.

cicd/docker-local/stage/usr/local/bin/run.sh

-14
This file was deleted.

compose.sh

-88
This file was deleted.

docker-compose.yaml

-31
This file was deleted.

0 commit comments

Comments
 (0)