Skip to content

Instantly share code, notes, and snippets.

@matsubo
Last active June 4, 2020 10:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matsubo/744c14d7127bc539c1b3ec8a6d226ace to your computer and use it in GitHub Desktop.
Save matsubo/744c14d7127bc539c1b3ec8a6d226ace to your computer and use it in GitHub Desktop.
Deploy to S3 using GitHub Actions
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