update bars #12
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: | |
push: | |
branches: [ production ] | |
env: | |
SERVICE_NAME: Ninja-qPCR-web | |
AWS_ROLE_ARN: ${{ secrets.AWS_ROLE_ARN }} | |
CF_DISTRIBUTION_ID: ${{ secrets.CF_DISTRIBUTION_ID }} | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} | |
SLACK_USERNAME: Ninja | |
SLACK_CHANNEL: pcr | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [16.x] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Build | |
run: | | |
npm install | |
gulp | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
role-to-assume: ${{ env.AWS_ROLE_ARN }} | |
aws-region: ap-northeast-1 | |
- name: Copy files to the test website with the AWS CLI | |
run: | | |
aws s3 sync production/ s3://pcr-ninja/production/ | |
aws cloudfront create-invalidation --distribution-id ${{ env.CF_DISTRIBUTION_ID }} --paths "/update/*" "/secure/*" | |
- name: Slack Notification on Success | |
if: ${{ success() }} | |
uses: rtCamp/action-slack-notify@v2 | |
env: | |
SLACK_TITLE: ${{ env.SERVICE_NAME }} Deploy Success | |
SLACK_COLOR: good | |
- name: Slack Notification on Failure | |
if: ${{ failure() }} | |
uses: rtCamp/action-slack-notify@v2 | |
env: | |
SLACK_TITLE: ${{ env.SERVICE_NAME }} Deploy Failure | |
SLACK_COLOR: danger |