Skip to content

Commit 90b1898

Browse files
authored
Merge pull request #7 from vsilent/testing
Testing
2 parents 4954a77 + b6cbe9b commit 90b1898

2 files changed

Lines changed: 35 additions & 17 deletions

File tree

.github/workflows/docker.yml

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ on:
44
push:
55
branches:
66
- master
7+
- testing
78
pull_request:
89
branches:
910
- master
1011

1112
jobs:
1213
cicd-linux-docker:
13-
name: CICD Linux for Docker
14+
name: Cargo and npm build
1415
runs-on: ubuntu-latest
1516
steps:
1617
- name: Checkout sources
@@ -56,28 +57,44 @@ jobs:
5657
command: build
5758
args: --release
5859

59-
- name: Set up Node.js
60-
uses: actions/setup-node@v1
61-
with:
62-
node-version: 14
63-
64-
- name: npm install
60+
- name: Build frontend
6561
working-directory: ./web
66-
run: npm install
62+
run: docker build . --file Dockerfile --tag web
6763

68-
- name: Build
64+
- name: Compile js
6965
working-directory: ./web
70-
run: npm run build
66+
run: docker run --rm -v $GITHUB_WORKSPACE/dist:/stackgog/dist web sh -c "npm run build"
67+
68+
# - name: npm install
69+
# working-directory: ./web
70+
# run: npm install
71+
#
72+
# - name: Build
73+
# working-directory: ./web
74+
# run: npm run build
7175

7276
# - name: Test
7377
# working-directory: ./web
7478
# run: npm test
7579

80+
# - name: Get npm cache directory
81+
# working-directory: ./web
82+
# id: npm-cache-dir
83+
# run: |
84+
# echo "::set-output name=dir::$(npm config get cache)"
85+
# - uses: actions/cache@v2
86+
# id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
87+
# with:
88+
# path: ${{ steps.npm-cache-dir.outputs.dir }}
89+
# key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
90+
# restore-keys: |
91+
# ${{ runner.os }}-node-
92+
7693
- name: Copy app files and zip
7794
run: |
78-
mkdir app
95+
mkdir -p app/stackdog/dist
7996
cp target/release/stackdog app/stackdog
80-
cp web/dist app/stackdog
97+
cp -a $GITHUB_WORKSPACE/dist/. app/stackdog
8198
cp docker/prod/Dockerfile app/Dockerfile
8299
cd app
83100
touch .env
@@ -111,5 +128,4 @@ jobs:
111128
repository: trydirect/stackdog
112129
add_git_labels: true
113130
tag_with_ref: true
114-
#no-cache: true
115-
context: ./app
131+
#no-cache: true

web/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@
44

55
We use Webpack dev server with hot reload, so you can serve it locally and see all changes immediately.
66

7+
`cd ./web`
78
`npm install`
89
`npm run start`
910

1011
OR
1112

12-
`docker build -t stackdog -f Dockerfile .`
13-
`docker run stackdog`
13+
`cd ./web`
14+
`docker build . -t stackdog`
15+
`docker run -p8080:8080 stackdog`
1416

1517
## Production build
1618

@@ -21,4 +23,4 @@ OR
2123

2224
# 1
2325
Never, ever, ever don't spend time on experimental react branch integration with TypeScript support.
24-
They unstable, and... just don't work endeed.
26+
They unstable, and... just don't work endeed.

0 commit comments

Comments
 (0)