Update NavMenu #5
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
name: Deploy on AWS Beanstalk | |
on: | |
push: | |
branches: [ "prod", "trunk" ] | |
pull_request: | |
branches: [ "prod", "trunk" ] | |
env: | |
PROJECT_LOCATION: src/Blazing.csproj | |
ELASTIC_BEANSTALK_NAME: Blazing | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
- name: Restore dependencies | |
run: dotnet restore $PROJECT_LOCATION | |
- name: Build | |
run: dotnet build --no-restore $PROJECT_LOCATION | |
- name: Pack | |
run: | | |
dotnet publish $PROJECT_LOCATION -c Release --output "${{ github.workspace }}/${{ github.run_id }}" | |
cd ${{ github.run_id }} | |
zip -r ../${{ github.run_id }}.zip . | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v4.3.3 | |
with: | |
name: deploy-files | |
path: ${{ github.run_id }}.zip | |
deploy: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- uses: actions/download-artifact@v4.1.7 | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-region: ap-southeast-2 | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
- name: Deploy | |
run: | | |
aws s3 cp "deploy-files/${{ github.run_id }}.zip" s3://elasticbeanstalk-ap-southeast-2-${{ secrets.AWS_ACCOUNT_ID }}/artifact/blazing-blazor-app/ | |
aws elasticbeanstalk create-application-version --application-name $ELASTIC_BEANSTALK_NAME --version-label ${{ github.run_id }} --description ${{ github.run_id }} --source-bundle S3Bucket="elasticbeanstalk-ap-southeast-2-${{ secrets.AWS_ACCOUNT_ID }}",S3Key="artifact/blazing-blazor-app/${{ github.run_id }}.zip" | |
aws elasticbeanstalk update-environment --application-name $ELASTIC_BEANSTALK_NAME --environment-name ${{ secrets.AWS_BEANSTALK_ENV }} --version-label ${{ github.run_id }} | |
aws elasticbeanstalk wait environment-updated --application-name $ELASTIC_BEANSTALK_NAME --environment-name ${{ secrets.AWS_BEANSTALK_ENV }} |