mirror of
https://github.com/Lissy93/web-check.git
synced 2025-02-01 19:19:20 +01:00
Update AWS workflow to update the deployment state for environments
This commit is contained in:
parent
8688fd23f5
commit
33e1adb974
36
.github/workflows/deploy-aws.yml
vendored
36
.github/workflows/deploy-aws.yml
vendored
@ -11,6 +11,7 @@ on:
|
|||||||
- api/**
|
- api/**
|
||||||
- serverless.yml
|
- serverless.yml
|
||||||
- package.json
|
- package.json
|
||||||
|
- .github/workflows/deploy-aws.yml
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy-api:
|
deploy-api:
|
||||||
@ -25,16 +26,33 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
node-version: 16
|
node-version: 16
|
||||||
|
|
||||||
|
- uses: chrnorm/deployment-action@releases/v1
|
||||||
|
name: Create GitHub deployment for API
|
||||||
|
id: deployment_api
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.BOT_TOKEN || secrets.GITHUB_TOKEN }}
|
||||||
|
environment: api
|
||||||
|
ref: ${{ github.ref }}
|
||||||
|
|
||||||
- name: Install Serverless CLI and dependencies
|
- name: Install Serverless CLI and dependencies
|
||||||
run: |
|
run: |
|
||||||
npm i -g serverless
|
npm i -g serverless
|
||||||
yarn
|
yarn
|
||||||
|
|
||||||
- name: Deploy to AWS
|
- name: Deploy to AWS
|
||||||
env:
|
env:
|
||||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
run: serverless deploy
|
run: serverless deploy
|
||||||
|
|
||||||
|
- name: Update GitHub deployment status (API)
|
||||||
|
if: always()
|
||||||
|
uses: chrnorm/deployment-status@releases/v1
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.BOT_TOKEN || secrets.GITHUB_TOKEN }}
|
||||||
|
state: "${{ job.status }}"
|
||||||
|
deployment_id: ${{ steps.deployment_api.outputs.deployment_id }}
|
||||||
|
ref: ${{ github.ref }}
|
||||||
|
|
||||||
deploy-frontend:
|
deploy-frontend:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@ -48,6 +66,14 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
node-version: 16
|
node-version: 16
|
||||||
|
|
||||||
|
- uses: chrnorm/deployment-action@releases/v1
|
||||||
|
name: Create GitHub deployment for Frontend
|
||||||
|
id: deployment_frontend
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.BOT_TOKEN || secrets.GITHUB_TOKEN }}
|
||||||
|
environment: frontend
|
||||||
|
ref: ${{ github.ref }}
|
||||||
|
|
||||||
- name: Install dependencies and build
|
- name: Install dependencies and build
|
||||||
run: |
|
run: |
|
||||||
yarn install
|
yarn install
|
||||||
@ -73,3 +99,13 @@ jobs:
|
|||||||
AWS_REGION: 'us-east-1'
|
AWS_REGION: 'us-east-1'
|
||||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
|
|
||||||
|
- name: Update GitHub deployment status (Frontend)
|
||||||
|
if: always()
|
||||||
|
uses: chrnorm/deployment-status@releases/v1
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.BOT_TOKEN || secrets.GITHUB_TOKEN }}
|
||||||
|
state: "${{ job.status }}"
|
||||||
|
deployment_id: ${{ steps.deployment_frontend.outputs.deployment_id }}
|
||||||
|
ref: ${{ github.ref }}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user