Skip to content

Commit

Permalink
Implemented autodeploy flow for UAT (#31ngcmh)
Browse files Browse the repository at this point in the history
  • Loading branch information
k2maan committed Nov 24, 2022
1 parent ddbc967 commit 3084b3b
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 6 deletions.
7 changes: 5 additions & 2 deletions .firebaserc
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@
"targets": {
"hotwax-digital-commerce": {
"hosting": {
"dev-fulfillment": [
"dev": [
"dev-fulfillment"
],
"uat": [
"uat-fulfillment"
]
}
},
"digital-commerce-71eb8": {
"hosting": {
"hotwax-fulfillment": [
"prod": [
"hotwax-fulfillment"
]
}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/firebase-hosting-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ jobs:
env:
HOTWAX_PUBLIC_SECRET: ${{ secrets.HOTWAX_PUBLIC_SECRET }}
- name: Deploy
run: firebase deploy --token "$HOTWAX_PUBLIC_SECRET" -m "Deploying via GitHub actions" --only hosting:dev-fulfillment
run: firebase deploy --token "$HOTWAX_PUBLIC_SECRET" -m "Deploying via GitHub actions" --only hosting:dev
env:
HOTWAX_PUBLIC_SECRET: ${{ secrets.HOTWAX_PUBLIC_SECRET }}
29 changes: 29 additions & 0 deletions .github/workflows/firebase-hosting-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Deploy to Firebase Hosting on release
'on':
push:
tags:
- '*' # Push events to every tag not containing / Refer https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#patterns-to-match-branches-and-tags
jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Checkout to latest release tag
run: |
git checkout $(git describe --tags `git rev-list --tags --max-count=1`)
- name: Install Dependencies
run: npm install
- name: Generate .env file
run: cp .env.example .env
- name: Build
run: npm run build
- name: Install Firebase
run: npm install -g firebase-tools
- name: Set Firebase project
run: firebase use default --token "$HOTWAX_PUBLIC_SECRET"
env:
HOTWAX_PUBLIC_SECRET: ${{ secrets.HOTWAX_PUBLIC_SECRET }}
- name: Deploy
run: firebase deploy --token "$HOTWAX_PUBLIC_SECRET" -m "Deploying via GitHub actions" --only hosting:uat
env:
HOTWAX_PUBLIC_SECRET: ${{ secrets.HOTWAX_PUBLIC_SECRET }}
18 changes: 15 additions & 3 deletions firebase.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"hosting": [
{
"target": "hotwax-fulfillment",
"target": "prod",
"public": "dist",
"ignore": [
"firebase.json",
Expand All @@ -15,7 +15,20 @@

},
{
"target": "dev-fulfillment",
"target": "dev",
"public": "dist",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [ {
"source": "**",
"destination": "/index.html"
} ]
},
{
"target": "uat",
"public": "dist",
"ignore": [
"firebase.json",
Expand All @@ -26,7 +39,6 @@
"source": "**",
"destination": "/index.html"
} ]

}
]
}

0 comments on commit 3084b3b

Please sign in to comment.