From ff966d26668183030b1822dfee6dde3763535985 Mon Sep 17 00:00:00 2001
From: vsilent <jabberroid@gmail.com>
Date: Wed, 10 Mar 2021 16:22:05 +0200
Subject: [PATCH 1/5] upload artifacts

---
 .github/workflows/docker.yml | 53 ++++++++++++++++++------------------
 1 file changed, 27 insertions(+), 26 deletions(-)

diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml
index 9f23df0..55dd60e 100644
--- a/.github/workflows/docker.yml
+++ b/.github/workflows/docker.yml
@@ -57,38 +57,39 @@ jobs:
           command: build
           args: --release
 
-      - name: Build frontend
-        working-directory: ./web
-        run: docker build . --file Dockerfile --tag web
-
-      - name: Compile js
-        working-directory: ./web
-        run: docker run --rm -v $GITHUB_WORKSPACE/dist:/stackgog/dist web sh -c "npm run build"
-
-#      - name: npm install
+#      Build with Docker
+#      - name: Build frontend
 #        working-directory: ./web
-#        run: npm install
+#        run: docker build . --file Dockerfile --tag web
 #
-#      - name: Build
+#      - name: Compile js
 #        working-directory: ./web
-#        run: npm run build
+#        run: docker run --rm -v $GITHUB_WORKSPACE/dist:/stackdog/dist web sh -c "npm run build"
+#
+#      - name: Display structure of dist
+#        run: ls -R $GITHUB_WORKSPACE/dist
 
-#      - name: Test
-#        working-directory: ./web
-#        run: npm test
+      - name: npm install, build, and test
+        working-directory: ./web
+        run: |
+          npm install
+          npm run build --if-present
+#          npm test
 
-#      - name: Get npm cache directory
-#        working-directory: ./web
-#        id: npm-cache-dir
-#        run: |
-#          echo "::set-output name=dir::$(npm config get cache)"
-#      - uses: actions/cache@v2
-#        id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
+      - name: Archive production artifacts
+        working-directory: ./web
+        uses: actions/upload-artifact@v2
+        with:
+          name: dist-without-markdown
+          path: |
+            dist
+            !dist/**/*.md
+
+#      - name: Archive code coverage results
+#        uses: actions/upload-artifact@v2
 #        with:
-#          path: ${{ steps.npm-cache-dir.outputs.dir }}
-#          key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
-#          restore-keys: |
-#            ${{ runner.os }}-node-
+#          name: code-coverage-report
+#          path: output/test/code-coverage.html
 
       - name: Copy app files and zip
         run: |

From 21c053fc54f55d851f79d14eb1011fdcd310d0ef Mon Sep 17 00:00:00 2001
From: vsilent <jabberroid@gmail.com>
Date: Wed, 10 Mar 2021 16:45:38 +0200
Subject: [PATCH 2/5] upload artifacts

---
 .github/workflows/docker.yml | 34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml
index 55dd60e..c9c830f 100644
--- a/.github/workflows/docker.yml
+++ b/.github/workflows/docker.yml
@@ -57,24 +57,24 @@ jobs:
           command: build
           args: --release
 
-#      Build with Docker
-#      - name: Build frontend
-#        working-directory: ./web
-#        run: docker build . --file Dockerfile --tag web
-#
-#      - name: Compile js
-#        working-directory: ./web
-#        run: docker run --rm -v $GITHUB_WORKSPACE/dist:/stackdog/dist web sh -c "npm run build"
-#
-#      - name: Display structure of dist
-#        run: ls -R $GITHUB_WORKSPACE/dist
+      #      Build with Docker
+      #      - name: Build frontend
+      #        working-directory: ./web
+      #        run: docker build . --file Dockerfile --tag web
+      #
+      #      - name: Compile js
+      #        working-directory: ./web
+      #        run: docker run --rm -v $GITHUB_WORKSPACE/dist:/stackdog/dist web sh -c "npm run build"
+      #
+      #      - name: Display structure of dist
+      #        run: ls -R $GITHUB_WORKSPACE/dist
 
       - name: npm install, build, and test
         working-directory: ./web
         run: |
           npm install
           npm run build --if-present
-#          npm test
+      #   npm test
 
       - name: Archive production artifacts
         working-directory: ./web
@@ -85,11 +85,11 @@ jobs:
             dist
             !dist/**/*.md
 
-#      - name: Archive code coverage results
-#        uses: actions/upload-artifact@v2
-#        with:
-#          name: code-coverage-report
-#          path: output/test/code-coverage.html
+      #      - name: Archive code coverage results
+      #        uses: actions/upload-artifact@v2
+      #        with:
+      #          name: code-coverage-report
+      #          path: output/test/code-coverage.html
 
       - name: Copy app files and zip
         run: |

From a0b4de7b64bc63b61e35fcb33943b00a35ac4870 Mon Sep 17 00:00:00 2001
From: vsilent <jabberroid@gmail.com>
Date: Wed, 10 Mar 2021 16:49:59 +0200
Subject: [PATCH 3/5] syntax fix

---
 .github/workflows/docker.yml | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml
index c9c830f..03205a1 100644
--- a/.github/workflows/docker.yml
+++ b/.github/workflows/docker.yml
@@ -73,24 +73,23 @@ jobs:
         working-directory: ./web
         run: |
           npm install
-          npm run build --if-present
+          npm run build
       #   npm test
 
       - name: Archive production artifacts
-        working-directory: ./web
         uses: actions/upload-artifact@v2
         with:
           name: dist-without-markdown
           path: |
             dist
             !dist/**/*.md
+        working-directory: ./web
 
-      #      - name: Archive code coverage results
-      #        uses: actions/upload-artifact@v2
-      #        with:
-      #          name: code-coverage-report
-      #          path: output/test/code-coverage.html
-
+#      - name: Archive code coverage results
+#        uses: actions/upload-artifact@v2
+#        with:
+#          name: code-coverage-report
+#          path: output/test/code-coverage.html
       - name: Copy app files and zip
         run: |
           mkdir -p app/stackdog/dist

From 433ac1b1220446550941294e29e1524a58b00d6c Mon Sep 17 00:00:00 2001
From: vsilent <jabberroid@gmail.com>
Date: Wed, 10 Mar 2021 17:24:56 +0200
Subject: [PATCH 4/5] try another approach

---
 .github/workflows/docker.yml | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml
index 03205a1..ebb9447 100644
--- a/.github/workflows/docker.yml
+++ b/.github/workflows/docker.yml
@@ -81,9 +81,8 @@ jobs:
         with:
           name: dist-without-markdown
           path: |
-            dist
-            !dist/**/*.md
-        working-directory: ./web
+            web/dist
+            !web/dist/**/*.md
 
 #      - name: Archive code coverage results
 #        uses: actions/upload-artifact@v2
@@ -94,7 +93,7 @@ jobs:
         run: |
           mkdir -p app/stackdog/dist
           cp target/release/stackdog app/stackdog
-          cp -a $GITHUB_WORKSPACE/dist/. app/stackdog
+          cp web/dist/. app/stackdog
           cp docker/prod/Dockerfile app/Dockerfile
           cd app
           touch .env

From c5ad45f81fb34f03dbca6e5e2894433eb7c31d2c Mon Sep 17 00:00:00 2001
From: vsilent <jabberroid@gmail.com>
Date: Wed, 10 Mar 2021 17:32:19 +0200
Subject: [PATCH 5/5] list files

---
 .github/workflows/docker.yml | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml
index ebb9447..a4c0802 100644
--- a/.github/workflows/docker.yml
+++ b/.github/workflows/docker.yml
@@ -89,11 +89,14 @@ jobs:
 #        with:
 #          name: code-coverage-report
 #          path: output/test/code-coverage.html
+      - name: Display structure of downloaded files
+        run: ls -R web/dist
+
       - name: Copy app files and zip
         run: |
           mkdir -p app/stackdog/dist
           cp target/release/stackdog app/stackdog
-          cp web/dist/. app/stackdog
+          cp -a web/dist/. app/stackdog
           cp docker/prod/Dockerfile app/Dockerfile
           cd app
           touch .env
