-
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
b378c8b
commit f3ed8d5
Showing
2 changed files
with
59 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,21 @@ | ||
name: Add-in Build | ||
on: push | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
environment: development | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Use Node.JS 20 LTS | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
- name: Build Add-in | ||
run: | | ||
echo "${{ secrets.BUILD_DOTENV }}" | base64 --decode > .env | ||
sed -i "/<AppDomain>https:\/\/quire.io\/<\/AppDomain>/a\ ${{ secrets.APP_DOMAIN }}" manifest.xml | ||
sed -i "s|const urlProd = \"https://add-in-hosting-cdn-url/\";|const urlProd = \"${{ secrets.URL_PROD }}\";|" webpack.config.js | ||
npm install | ||
npm run build | ||
find ./dist -name "*.map" -type f | xargs rm -f | ||
find ./dist -name "*.LICENSE.txt" -type f | xargs rm -f |
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,38 @@ | ||
name: Add-in Build and Deploy | ||
on: | ||
push: | ||
tags: | ||
- "*-prod" | ||
permissions: | ||
id-token: write | ||
contents: read | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
environment: production | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Use Node.JS 20 LTS | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
- name: Build Add-in | ||
run: | | ||
echo "${{ secrets.BUILD_DOTENV }}" | base64 --decode > .env | ||
sed -i "/<AppDomain>https:\/\/quire.io\/<\/AppDomain>/a\ ${{ secrets.APP_DOMAIN }}" manifest.xml | ||
sed -i "s|const urlProd = \"https://add-in-hosting-cdn-url/\";|const urlProd = \"${{ secrets.URL_PROD }}\";|" webpack.config.js | ||
npm install | ||
npm run build | ||
find ./dist -name "*.map" -type f | xargs rm -f | ||
find ./dist -name "*.LICENSE.txt" -type f | xargs rm -f | ||
- name: Deploy to AWS | ||
uses: aws-actions/configure-aws-credentials@v4.0.2 | ||
with: | ||
role-to-assume: arn:aws:iam::277130567782:role/Github_Action_Deploy_Role | ||
role-session-name: GitHub_to_AWS_via_FederatedOIDC | ||
aws-region: us-west-2 | ||
- name: Deploy dist file to prod | ||
run: | | ||
aws s3 rm --recursive s3://quire-outlook | ||
aws s3 cp --recursive ./dist/ s3://quire-outlook | ||
aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_ID }} --paths /* |