@@ -13,11 +13,13 @@ jobs:
1313 - name : Fix permissions before checkout
1414 run : sudo chown -R $USER:$USER $GITHUB_WORKSPACE
1515
16+ - name : Force delete previous build artifacts
17+ run : sudo rm -rf $GITHUB_WORKSPACE/* || true
1618
1719 - name : Checkout repository
1820 uses : actions/checkout@v3
1921 with :
20- ref : staging
22+ ref : staging
2123 clean : true
2224
2325 - name : Create hoops_license.txt
2628 ls -l hoops_license.txt # Verify file exists
2729 cat hoops_license.txt # Debugging: Check file content (remove in production)
2830
29- - name : Inject Host IP into index.html
30- run : |
31- sed -i 's|<head>|<head>\n<script>window.HOST_IP="${{ secrets.HOST_IP }}";</script>|' ./public/index.html
32-
3331 - name : Write SSL certificates to files
3432 run : |
3533 pwd # Print the current working directory
4846 fi
4947 ls -la certs/
5048
51- - name : Set Environment Variable for Docker
52- run : echo "HOST_IP=${{ secrets.HOST_IP }}" >> $GITHUB_ENV
53-
5449 - name : Login to GitHub Packages
5550 run : echo "${{ secrets.GHCR_PAT }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
5651
@@ -62,18 +57,12 @@ jobs:
6257 docker pull ghcr.io/techsoft3d/streaming-server:staging
6358 docker pull ghcr.io/techsoft3d/node-server:staging
6459
65- - name : 🔍 Debug public-staging existence
66- run : |
67- echo "Working directory: $(pwd)"
68- ls -la
69- ls -la public-staging
70-
7160 - name : Copy `./public-staging` into External Docker Volume (Using Temporary Container)
7261 run : |
7362 docker run --rm \
7463 -v public-staging:/volume \
7564 -v $(pwd)/public-staging:/backup \
76- alpine sh -c "ls /backup && cp -r /backup/* /volume/ || echo 'Nothing to copy' "
65+ alpine sh -c "cp -r /backup/* /volume/ && ls -la /volume/ "
7766
7867 - name : Build and Run Docker Containers
7968 run : |
8776 - name : Fix permissions before checkout
8877 run : sudo chown -R $USER:$USER $GITHUB_WORKSPACE
8978
79+ - name : Force delete previous build artifacts
80+ run : sudo rm -rf $GITHUB_WORKSPACE/* || true
81+
9082 - name : Checkout repository
9183 uses : actions/checkout@v3
9284 with :
9991 ls -l hoops_license.txt # Verify file exists
10092 cat hoops_license.txt # Debugging: Check file content (remove in production)
10193
102- - name : Inject Host IP into index.html
103- run : |
104- sed -i 's|<head>|<head>\n<script>window.HOST_IP="${{ secrets.HOST_IP }}";</script>|' ./public/index.html
105-
10694 - name : Write SSL certificates to files
10795 run : |
10896 pwd # Print the current working directory
@@ -121,9 +109,6 @@ jobs:
121109 fi
122110 ls -la certs/
123111
124- - name : Set Environment Variable for Docker
125- run : echo "HOST_IP=${{ secrets.HOST_IP }}" >> $GITHUB_ENV
126-
127112 - name : Login to GitHub Packages
128113 run : echo "${{ secrets.GHCR_PAT }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
129114
@@ -135,18 +120,12 @@ jobs:
135120 docker pull ghcr.io/techsoft3d/streaming-server:staging
136121 docker pull ghcr.io/techsoft3d/node-server:staging
137122
138- - name : 🔍 Debug public-staging existence
139- run : |
140- echo "Working directory: $(pwd)"
141- ls -la
142- ls -la public-staging
143-
144123 - name : Copy `./public-staging` into External Docker Volume (Using Temporary Container)
145124 run : |
146125 docker run --rm \
147126 -v public-staging:/volume \
148127 -v $(pwd)/public-staging:/backup \
149- alpine sh -c "ls /backup && cp -r /backup/* /volume/ || echo 'Nothing to copy' "
128+ alpine sh -c "cp -r /backup/* /volume/ && ls -la /volume/ "
150129
151130 - name : Build and Run Docker Containers
152131 run : |
0 commit comments