-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(surge): update surge demo for theme demo
- Loading branch information
1 parent
076193b
commit 1ad98bc
Showing
1 changed file
with
58 additions
and
4 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 |
---|---|---|
|
@@ -5,8 +5,62 @@ on: | |
branches: [ master ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
name: Deploying Demo to Master | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
- name: Build Demo | ||
run: | | ||
npm ci | ||
npm run build | ||
- name: Update HTML Scripts | ||
run: | | ||
curl https://raw.githubusercontent.com/AlaskaAirlines/auro-library/main/scripts/setup/useBundles.js -o useBundles.js | ||
node useBundles.js | ||
- name: Create Surge Domain | ||
run: | | ||
repo_name=$(echo ${{github.repository}} | tr "/#" -) | ||
branch_domain_name=$(echo ${{github.head_ref}} | tr "/#" -) | ||
echo "domain_name=$repo_name-$branch_domain_name.surge.sh" >> $GITHUB_ENV | ||
- name: Deploy to Surge | ||
run: | | ||
npm install -g [email protected]; | ||
surge ./ ${{env.domain_name}} --token ${{secrets.AURO_SURGE_TOKEN}} | tee surge_output.txt | ||
cat surge_output.txt | ||
deployment_output=$(cat surge_output.txt | grep -e "Success\|Error\|Aborted" | sed 's/\x1B\[[0-9;]\{1,\}[A-Za-z]//g') | ||
success_message="Success" | ||
! [[ $deployment_output =~ $success_message ]] && exit 1 | ||
echo "deployment_output=$deployment_output" >> $GITHUB_ENV | ||
- name: Format Deployment Message | ||
run: | | ||
npm install -g urls-md@5; | ||
deployment_message=$(echo "${{env.deployment_output}}/demo/" | urls-md) | ||
echo "deployment_result=$deployment_message" >> $GITHUB_ENV | ||
- name: Comment Success to PR | ||
uses: thollander/actions-comment-pull-request@v2 | ||
with: | ||
message: | | ||
Surge demo deployment succeeded! 🚀🚀🚀 | ||
${{env.deployment_result}} | ||
comment_tag: demo_comment | ||
|
||
- name: Comment Failure to PR | ||
uses: thollander/actions-comment-pull-request@v2 | ||
if: ${{failure()}} | ||
with: | ||
message: | | ||
Surge demo deployment failed! 😭 | ||
comment_tag: demo_comment | ||
|
||
|
||
call-publish-demo-workflow: | ||
uses: AlaskaAirlines/auro-library/.github/workflows/publishDemo.yml@main | ||
secrets: | ||
AURO_SURGE_TOKEN: ${{secrets.AURO_SURGE_TOKEN}} |