Merge pull request #119 from BuildingEnergyTools/develop #166
This file contains hidden or 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
| name: Deploy | |
| on: | |
| push: | |
| branches: | |
| - develop | |
| - main | |
| - nrel | |
| - lbnl | |
| - pnnl | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout 🛎️ | |
| uses: actions/checkout@v5 | |
| - name: Set node version | |
| uses: actions/setup-node@v5 | |
| with: | |
| node-version: 16.18.0 | |
| - name: Install and Build | |
| run: | | |
| npm ci | |
| npm install @angular/cli > /dev/null | |
| # Ensure consistent output hashing for runtime files | |
| npx ng build --output-hashing=bundles | |
| - name: Deploy Main Site | |
| uses: JamesIves/github-pages-deploy-action@v4.7.3 | |
| if: github.ref == 'refs/heads/main' | |
| with: | |
| branch: gh-pages | |
| folder: dist | |
| - name: Deploy S3 Production | |
| env: | |
| AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY}} | |
| AWS_REGION: us-east-1 | |
| if: github.ref == 'refs/heads/main' | |
| run: | | |
| # Deploy HTML files with no-cache to prevent stale references | |
| aws s3 sync --delete ./dist s3://${{ secrets.AWS_PROD_BUCKET }} \ | |
| --exclude "*" --include "*.html" \ | |
| --cache-control "no-cache, no-store, must-revalidate" | |
| # Deploy all other files normally | |
| aws s3 sync ./dist s3://${{ secrets.AWS_PROD_BUCKET }} \ | |
| --exclude "*.html" | |
| - name: Deploy S3 Staging | |
| env: | |
| AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY}} | |
| AWS_REGION: us-east-1 | |
| if: github.ref == 'refs/heads/develop' | |
| run: | | |
| # Deploy HTML files with no-cache to prevent stale references | |
| aws s3 sync --delete ./dist s3://${{ secrets.AWS_STAGING_BUCKET }} \ | |
| --exclude "*" --include "*.html" \ | |
| --cache-control "no-cache, no-store, must-revalidate" | |
| # Deploy all other files normally | |
| aws s3 sync ./dist s3://${{ secrets.AWS_STAGING_BUCKET }} \ | |
| --exclude "*.html" |