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
shashwatbangar committed Nov 30, 2022
1 parent 6a934d2 commit c6a6da6
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 5 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-hotwax-preorder": [
"dev": [
"dev-hotwax-preorder"
],
"uat": [
"preorder-uat"
]
}
},
"digital-commerce-71eb8": {
"hosting": {
"hotwax-preorder": [
"prod": [
"hotwax-preorder"
]
}
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-hotwax-preorder
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 }}
17 changes: 15 additions & 2 deletions firebase.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"hosting": [
{
"target": "dev-hotwax-preorder",
"target": "dev",
"public": "dist",
"ignore": [
"firebase.json",
Expand All @@ -14,7 +14,20 @@
} ]
},
{
"target": "hotwax-preorder",
"target": "prod",
"public": "dist",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [ {
"source": "**",
"destination": "/index.html"
} ]
},
{
"target": "uat",
"public": "dist",
"ignore": [
"firebase.json",
Expand Down

0 comments on commit c6a6da6

Please sign in to comment.