update_contentful #511
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: Build and Deploy | |
on: | |
push: | |
branches: | |
- main | |
repository_dispatch: | |
jobs: | |
Build-and-Deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- run: echo "${{ secrets.SERVER_KEY }}" > aws_lightsail_key | |
- run: chmod 600 ./aws_lightsail_key | |
- run: ssh -o StrictHostKeyChecking=no -i ./aws_lightsail_key ${{ secrets.SERVER_USERNAME }}@${{ secrets.SERVER_HOST }} "cd /var/www/html/mrc && git pull origin main && bash scripts/rebuild.sh" | |
- uses: rtCamp/action-slack-notify@v2 | |
env: | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} | |
SLACK_CHANNEL: "website-mrc" | |
SLACK_ICON: https://s3-us-west-2.amazonaws.com/slack-files2/avatars/2021-07-06/2257469713729_06357f0ef4a522dfb049_72.png | |
SLACK_USERNAME: "MRC GitHub Actions" | |
SLACK_MESSAGE: "GitHub Actions が完了し、MRC(モビリティ研究センター)HP が更新されました!" |