-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
82c65e3
commit 87551e2
Showing
3 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Deploy app when is tagged on main branch (a release is published) | ||
name: release | ||
|
||
on: | ||
release: | ||
types: [created] | ||
|
||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
# Allow one concurrent deployment, but do not cancel in-progress runs | ||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
deploy: | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup Pages | ||
uses: actions/configure-pages@v4 | ||
|
||
- name: Prepare release | ||
working-directory: dashgit-web | ||
run: | | ||
chmod u+rx ./prepare-release.sh | ||
./prepare-release.sh "$GITHUB_REF_NAME" | ||
- name: Upload artifact to deploy | ||
uses: actions/upload-pages-artifact@v3.0.1 | ||
with: | ||
path: 'dashgit-web/dist' | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4.0.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
# Prepares the distribution for release and set version number | ||
|
||
# Ensure this script is running in his folder | ||
SCRIPT_DIR=$(readlink -f $0 | xargs dirname) | ||
echo "run command at directory: $SCRIPT_DIR" | ||
cd $SCRIPT_DIR | ||
|
||
# Ensure version to set is passed as parameter | ||
VERSION=$1 | ||
if test -z "$VERSION"; then | ||
echo "Required parameter: version to set" | ||
exit 1 | ||
fi | ||
echo "Set version to $VERSION" | ||
|
||
# Copy app files to dist and set version numbers (in index.html and *.js to prevent cache problems) | ||
rm -rf ./dist/ | ||
cp -rf ./app ./dist | ||
find ./dist/*.js -type f -exec sed -i "s/.js\"/.js\?v=${VERSION}\"/g" {} \; | ||
sed -i "s/IndexController.js/IndexController.js?v=${VERSION}/g" dist/index.html | ||
sed -i "s/\"v0.0.0-local\"/\"${VERSION}\"/g" dist/Config.js |