Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixing cicd #137

Merged
merged 5 commits into from
Oct 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.