Skip to content

Commit d7d11e1

Browse files
Testing fixed? (#8)
* Fixed overwritting other envs files (#2) * made changes * modified package dependencies * Updated Angular version and Added PWA capability * Created workflow for auto-deploy to GH pages * Fixed wrong pwa icons path * Fixed wrong favicon path * fixed deleting other envs folders * fixed deleting other envs folders * fixed deleting other envs folders * test * trying to fix development and test envs unaccesible and removed unnecesary files * test (#4) * made changes * modified package dependencies * Updated Angular version and Added PWA capability * Created workflow for auto-deploy to GH pages * Fixed wrong pwa icons path * Fixed wrong favicon path * fixed deleting other envs folders * fixed deleting other envs folders * fixed deleting other envs folders * test * trying to fix development and test envs unaccesible and removed unnecesary files * trying to fix development and test envs unaccesible and removed unnecesary files * Test (#6) * made changes * modified package dependencies * Updated Angular version and Added PWA capability * Created workflow for auto-deploy to GH pages * Fixed wrong pwa icons path * Fixed wrong favicon path * fixed deleting other envs folders * fixed deleting other envs folders * fixed deleting other envs folders * test * trying to fix development and test envs unaccesible and removed unnecesary files * trying to fix development and test envs unaccesible and removed unnecesary files * fixed deleting other envs folders * deleted loop created on dev and test routes * Test fixed? (#7) * made changes * modified package dependencies * Updated Angular version and Added PWA capability * Created workflow for auto-deploy to GH pages * Fixed wrong pwa icons path * Fixed wrong favicon path * fixed deleting other envs folders * fixed deleting other envs folders * fixed deleting other envs folders * test * trying to fix development and test envs unaccesible and removed unnecesary files * trying to fix development and test envs unaccesible and removed unnecesary files * fixed deleting other envs folders * deleted loop created on dev and test routes * fixed?
1 parent df0dcc9 commit d7d11e1

2 files changed

Lines changed: 31 additions & 5 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ jobs:
1515
id: set-env
1616
run: |
1717
echo "::set-output name=build_env::$(if [ '${{ github.ref }}' = 'refs/heads/release' ]; then echo 'production'; else echo 'development'; fi)"
18-
echo "::set-output name=path::$(if [ '${{ github.ref }}' = 'refs/heads/release' ]; then echo '/'; elif [ '${{ github.ref }}' = 'refs/heads/testing' ]; then echo '/test'; else echo '/development'; fi)"
19-
echo "::set-output name=page_root::$(if [ '${{ github.ref }}' = 'refs/heads/release' ]; then echo '/CheemsBonkGame/'; elif [ '${{ github.ref }}' = 'refs/heads/testing' ]; then echo '/CheemsBonkGame/test/'; else echo '/CheemsBonkGame/development/'; fi)"
18+
echo "::set-output name=path::$(if [ '${{ github.ref }}' = 'refs/heads/release' ]; then echo 'app'; elif [ '${{ github.ref }}' = 'refs/heads/testing' ]; then echo 'test'; else echo 'development'; fi)"
19+
echo "::set-output name=page_root::$(if [ '${{ github.ref }}' = 'refs/heads/release' ]; then echo '/CheemsBonkGame/app/'; elif [ '${{ github.ref }}' = 'refs/heads/testing' ]; then echo '/CheemsBonkGame/test/'; else echo '/CheemsBonkGame/development/'; fi)"
2020
echo "::set-output name=build_prefix::$(if [ '${{ github.ref }}' = 'refs/heads/release' ]; then echo 'prod'; elif [ '${{ github.ref }}' = 'refs/heads/testing' ]; then echo 'test'; else echo 'dev'; fi)"
2121
- name: Checkout code
2222
uses: actions/checkout@v3
@@ -73,19 +73,30 @@ jobs:
7373
git fetch origin gh-pages
7474
git worktree add deploy-folder gh-pages
7575
76+
- name: backup lower environment files
77+
if: ${{ steps.set-env.outputs.build_env == 'production' }}
78+
env:
79+
build_env: ${{ steps.set-env.outputs.build_env }}
80+
run: |
81+
mkdir -p development-backup
82+
mkdir -p test-backup
83+
cp -r deploy-folder/development/* development-backup/ || true
84+
cp -r deploy-folder/test/* test-backup/ || true
85+
7686
- name: Clean Deployment Directory
7787
env:
7888
path: ${{ steps.set-env.outputs.path }}
7989
run: |
80-
target_dir="deploy-folder$path"
90+
target_dir="deploy-folder/$path"
8191
mkdir -p "$target_dir"
82-
find "$target_dir" -mindepth 1 -maxdepth 1 -exec rm -rf {} +
92+
find "$target_dir" -mindepth 1 -not -name '.git' -exec rm -rf {} +
8393
8494
- name: Copy New Files to Deploy Folder
8595
env:
8696
path: ${{ steps.set-env.outputs.path }}
97+
build_env: ${{ steps.set-env.outputs.build_env }}
8798
run: |
88-
target_dir="deploy-folder$path"
99+
target_dir="deploy-folder/$path"
89100
mkdir -p "$target_dir"
90101
cp -r dist/cheems-angular/browser/* "$target_dir/"
91102
cp README.md .gitignore "$target_dir/"

.pwa/index.html

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<meta http-equiv="refresh" content="0; url=/CheemsBonkGame/app/">
7+
<title>Cheems Bonk Game</title>
8+
</head>
9+
<body>
10+
<noscript>
11+
<strong>We're sorry but Cheems Bonk Game doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
12+
</noscript>
13+
<p>If you are not redirected automatically, follow this <a href="/CheemsBonkGame/app/">link to the app</a>.</p>
14+
</body>
15+
</html>

0 commit comments

Comments
 (0)