Last active
June 4, 2020 10:17
-
-
Save matsubo/744c14d7127bc539c1b3ec8a6d226ace to your computer and use it in GitHub Desktop.
Deploy to S3 using GitHub Actions
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: Upload Website | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@master | |
- name: Deploy | |
uses: jakejarvis/s3-sync-action@master | |
with: | |
args: --acl public-read --follow-symlinks --delete | |
env: | |
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_REGION: 'ap-northeast-1' # optional: defaults to us-east-1 | |
SOURCE_DIR: 'public' # optional: defaults to entire repository | |
- name: Slack Notification | |
uses: 8398a7/action-slack@v2 | |
if: always() | |
with: | |
status: ${{ job.status }} | |
author_name: 'deploy' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment