Skip to content

Instantly share code, notes, and snippets.

@apgapg
Created July 1, 2021 07:34
Show Gist options
  • Save apgapg/7f46f99f400fe70e69b983ab96d80ba4 to your computer and use it in GitHub Desktop.
Save apgapg/7f46f99f400fe70e69b983ab96d80ba4 to your computer and use it in GitHub Desktop.
name: Azure Static Web Apps CI/CD
on:
push:
branches:
- dev/docker
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Node.js version
uses: actions/setup-node@v1
with:
node-version: '14.x'
- name: npm install on server
working-directory: ./server
run: |
npm install
- name: npm install on client
working-directory: ./client
run: |
npm install
- name: npm build client
working-directory: ./client
run: |
npm run build
- name: npm build server
working-directory: ./server
run: |
npm run build
- name: Generate deployment package
working-directory: ./server
run: zip -r ../deploy.zip * -x "**node_modules**"
- name: Get timestamp
uses: gerred/actions/current-time@master
id: current-time
- name: Run string replace
uses: frabert/replace-string-action@master
id: format-time
with:
pattern: '[:\.]+'
string: "${{ steps.current-time.outputs.time }}"
replace-with: '-'
flags: 'g'
- name: Beanstalk Deploy for app
uses: einaregilsson/beanstalk-deploy@v17
with:
aws_access_key: ${{secrets.AWS_ACCESS_KEY}}
aws_secret_key: ${{secrets.AWS_SECRET_KEY}}
application_name: Online DMS
environment_name: Onlinedms-env
region: ap-south-1
version_label: "dms-${{ steps.format-time.outputs.replaced }}"
deployment_package: deploy.zip
- name: Deployed!
run: echo App deployed to ELB successfully
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment