Skip to content

Commit

Permalink
fixing cicd (#137)
Browse files Browse the repository at this point in the history
* fixing cicd

* FORGOT THE DOT!

* fixed dockerfile

* Revert "fixed dockerfile"

This reverts commit e374432.

* fixed cicd
  • Loading branch information
ebauman authored Oct 26, 2022
1 parent 68bb8dc commit 35b540c
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 175 deletions.
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
/.git
/dist
/node_modules
23 changes: 14 additions & 9 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ on: [push, pull_request]

env:
app_image: hobbyfarm/admin-ui
sdk_image: hobbyfarm/admin-ui-sdk
dockerfile: cicd/docker/Dockerfile

should_push_image: |-
${{
Expand All @@ -29,14 +27,21 @@ jobs:
- name: Checkout
uses: actions/checkout@master

- name: Setup npm cache
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'npm'

- name: Install deps
run: npm install

- name: Build
run: |
docker build -f $dockerfile --tag $sdk_image --target sdk .
run: npm run build:prod

- name: Build Release
if: fromJSON(env.should_push_image)
- name: Build
run: |
docker build -f $dockerfile --tag $app_image .
docker build -f cicd/Dockerfile -t $app_image:${GIT_COMMIT_SHORT_HASH:-dev} .
- name: Docker Login
if: fromJSON(env.should_push_image)
Expand All @@ -50,9 +55,9 @@ jobs:
safe_ref=$(echo "${{ github.ref_name }}" | sed -e 's/[^a-zA-Z0-9\-\.]/-/g')
publish_tag=$app_image:$safe_ref
docker tag $app_image $publish_tag
docker tag $app_image:${GIT_COMMIT_SHORT_HASH:-dev} $publish_tag
docker push $publish_tag
- name: Docker Push Latest
if: fromJSON(env.should_tag_latest)
run: docker push $app_image
run: docker push $app_image:latest
File renamed without changes.
11 changes: 11 additions & 0 deletions cicd/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Should only be used with GitHub Actions cicd
# For local, refer to Dockerfile at root of project

FROM nginx:stable-alpine

COPY dist/* /usr/share/nginx/html

# copy staged files
COPY cicd/stage-release/ /

ENTRYPOINT ["entrypoint.sh"]
26 changes: 0 additions & 26 deletions cicd/docker-local/Dockerfile

This file was deleted.

6 changes: 0 additions & 6 deletions cicd/docker-local/stage/etc/fixuid/config.yml

This file was deleted.

14 changes: 0 additions & 14 deletions cicd/docker-local/stage/usr/local/bin/run.sh

This file was deleted.

88 changes: 0 additions & 88 deletions compose.sh

This file was deleted.

31 changes: 0 additions & 31 deletions docker-compose.yaml

This file was deleted.

0 comments on commit 35b540c

Please sign in to comment.