-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Release v1.23.1 ### 🔁 CI * **deploy-to-production**: deployment to production is triggered on tag creation
- Loading branch information
1 parent
c10b9a9
commit 4555fcd
Showing
4 changed files
with
66 additions
and
57 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,61 @@ | ||
name: 🛰️ Deploy To Production Workflow | ||
|
||
on: | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
deploy: | ||
name: Deploy to production 🛰️ | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Setup GitHub repository 🔧 | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.release.tag_name }} | ||
fetch-depth: 0 | ||
fetch-tags: true | ||
|
||
- name: Setup NodeJS ✨ | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: '.nvmrc' | ||
cache: 'npm' | ||
|
||
- name: Restore npm dependencies from cache 🥡 | ||
uses: actions/cache/restore@v3 | ||
id: cache-node-modules | ||
with: | ||
path: node_modules | ||
key: ${{ runner.os }}-npm-v3-${{ hashFiles('package-lock.json') }} | ||
|
||
- name: Write production .env file 📝 | ||
run: | | ||
npx rimraf env/.env.production | ||
echo ENVIRONMENT="production" >> env/.env.production | ||
echo DATABASE_HOST="${{ secrets.PRODUCTION_DATABASE_HOST }}" >> env/.env.production | ||
echo DATABASE_NAME="${{ secrets.PRODUCTION_DATABASE_NAME }}" >> env/.env.production | ||
echo DATABASE_USERNAME="${{ secrets.PRODUCTION_DATABASE_USERNAME }}" >> env/.env.production | ||
echo DATABASE_PASSWORD="${{ secrets.PRODUCTION_DATABASE_PASSWORD }}" >> env/.env.production | ||
cat env/.env.production | ||
- name: Build app ✨ | ||
run: npm run build | ||
|
||
- name: Auth to GCP ☁️ | ||
uses: 'google-github-actions/auth@v1' | ||
with: | ||
credentials_json: ${{ secrets.PRODUCTION_GCP_SA_KEY }} | ||
|
||
- name: Transform and format version for GCP ♻️ | ||
id: format-version-for-gcp | ||
run: | | ||
version=${{ github.event.release.tag_name }} | ||
version=${version//./-} | ||
echo "FORMATTED_VERSION_FOR_GCP=${version}" >> $GITHUB_OUTPUT | ||
- name: Deploy to production 🛰️ | ||
uses: 'google-github-actions/deploy-appengine@v1' | ||
with: | ||
project_id: ${{ secrets.PRODUCTION_GCP_PROJECT_ID }} | ||
flags: "--version=${{ steps.format-version-for-gcp.outputs.FORMATTED_VERSION_FOR_GCP }}" |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: ⛵️ Push on develop branch Workflow | ||
name: ⛵️ Push On Develop Branch Workflow | ||
|
||
on: | ||
push: | ||
|
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