• Stars
    star
    1,032
  • Rank 44,644 (Top 0.9 %)
  • Language
    Shell
  • License
    MIT License
  • Created about 5 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

๐Ÿ”„ GitHub Action to sync a directory with a remote S3 bucket ๐Ÿงบ

GitHub Action to Sync S3 Bucket ๐Ÿ”„

This simple action uses the vanilla AWS CLI to sync a directory (either from your repository or generated during your workflow) with a remote S3 bucket.

Usage

workflow.yml Example

Place in a .yml file such as this one in your .github/workflows folder. Refer to the documentation on workflow YAML syntax here.

As of v0.3.0, all aws s3 sync flags are optional to allow for maximum customizability (that's a word, I promise) and must be provided by you via args:.

The following example includes optimal defaults for a public static website:

  • --acl public-read makes your files publicly readable (make sure your bucket settings are also set to public).
  • --follow-symlinks won't hurt and fixes some weird symbolic link problems that may come up.
  • Most importantly, --delete permanently deletes files in the S3 bucket that are not present in the latest version of your repository/build.
  • Optional tip: If you're uploading the root of your repository, adding --exclude '.git/*' prevents your .git folder from syncing, which would expose your source code history if your project is closed-source. (To exclude more than one pattern, you must have one --exclude flag per exclusion. The single quotes are also important!)
name: Upload Website

on:
  push:
    branches:
    - master

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - 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: 'us-west-1'   # optional: defaults to us-east-1
        SOURCE_DIR: 'public'      # optional: defaults to entire repository

Configuration

The following settings must be passed as environment variables as shown in the example. Sensitive information, especially AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY, should be set as encrypted secrets โ€”ย otherwise, they'll be public to anyone browsing your repository's source code and CI logs.

Key Value Suggested Type Required Default
AWS_ACCESS_KEY_ID Your AWS Access Key. More info here. secret env Yes N/A
AWS_SECRET_ACCESS_KEY Your AWS Secret Access Key. More info here. secret env Yes N/A
AWS_S3_BUCKET The name of the bucket you're syncing to. For example, jarv.is or my-app-releases. secret env Yes N/A
AWS_REGION The region where you created your bucket. Set to us-east-1 by default. Full list of regions here. env No us-east-1
AWS_S3_ENDPOINT The endpoint URL of the bucket you're syncing to. Can be used for VPC scenarios or for non-AWS services using the S3 API, like DigitalOcean Spaces. env No Automatic (s3.amazonaws.com or AWS's region-specific equivalent)
SOURCE_DIR The local directory (or file) you wish to sync/upload to S3. For example, public. Defaults to your entire repository. env No ./ (root of cloned repository)
DEST_DIR The directory inside of the S3 bucket you wish to sync/upload to. For example, my_project/assets. Defaults to the root of the bucket. env No / (root of bucket)

License

This project is distributed under the MIT license.

More Repositories

1

awesome-shodan-queries

๐Ÿ” A collection of interesting, funny, and depressing search queries to plug into shodan.io ๐Ÿ‘ฉโ€๐Ÿ’ป
5,688
star
2

lighthouse-action

๐Ÿ’ก๐Ÿ  GitHub Action for running @GoogleChromeLabs Lighthouse webpage audits
Shell
343
star
3

subtake

Automatic finder for subdomains vulnerable to takeover. Written in Go, based on @haccer's subjack.
Go
145
star
4

cloudflare-purge-action

๐Ÿ—‘๏ธ GitHub Action to purge a website's cache via the Cloudflare API
Shell
134
star
5

datacenter-speed-tests

โšก Test speed and pings to all DigitalOcean, Linode, AWS, GCP, and Vultr regions
Shell
94
star
6

jarv.is

๐Ÿก My humble abode on the World Wide Web
MDX
91
star
7

bounty-domains

List of domains in scope for bug bounties (HackerOne, Bugcrowd, etc.)
70
star
8

wait-action

๐Ÿ’ค Very, very simple (and small) action to sleep for an amount of time โ€” 10s, 2m, etc.
Dockerfile
64
star
9

hugo-docker

โœ๏ธ Dockerized Hugo Extended with PostCSS, Babel, Pandoc, and more baked-in. Now with multi-architecture support!
Dockerfile
50
star
10

kitboga-bank

Mirror of Kitboga's fake bank account repository on BitBucket, please submit new themes there!
CSS
36
star
11

hugo-build-action

โœ๏ธ Hugo as a GitHub Action. Supports legacy versions back to v0.27 for compatibility.
Dockerfile
32
star
12

y2k

๐Ÿ’พ Windows Meยฎ, but fully isolated and disposable โ€”ย the way it was meant to be.
Ruby
32
star
13

docker-cloudflare-argo

An intermediary between Cloudflare's Argo tunneling service and your local containers/network.
Dockerfile
23
star
14

cloudflare-ufw-updater

๐Ÿ”ฅ ๐Ÿงฑ UFW rule updater to only allow HTTP and HTTPS traffic from Cloudflare IP address ranges
Shell
21
star
15

netlify-plugin-cache

โšก Generic plugin for caching any files and/or folders between Netlify builds
JavaScript
21
star
16

jakejarvis

hey ๐Ÿ‘‹
JavaScript
20
star
17

ios-trackers

Blocklist of tracking domains used by iOS and popular apps.
18
star
18

dotfiles

๐Ÿ’ป My .files
Shell
16
star
19

awesome-first-code

๐Ÿ‘ถ An awesome list for those who are brave enough to share their first programming projects ever. No shame allowed here!
15
star
20

simpip

๐ŸŒŽ A very "simple" web server that returns your IP address in plaintext...and literally nothing else.
JavaScript
15
star
21

hugo-mod-twemoji

Twemojis as a plug-and-play module for Hugo sites ๐Ÿ“ฆ
HTML
14
star
22

mastodon-installer

๐Ÿฆฃ Mastodon auto-installer for self-hosted instances
Shell
12
star
23

dark-mode

๐ŸŒ“ Super simple CSS theme switching with saved preferences and automatic OS setting detection
HTML
9
star
24

backblaze-b2-action

๐Ÿ”„ GitHub Action to sync a directory with a remote Backblaze B2 bucket ๐Ÿ”ฅ
Shell
9
star
25

mastodon-utils

๐Ÿฆฃ Small opinionated helper scripts, patches, and configs for Mastodon
Shell
9
star
26

firebase-deploy-action

๐Ÿ”ฅ GitHub Action to deploy a static site to Firebase Hosting
Dockerfile
8
star
27

npqueue

Active and queued player list for NoPixel GTA RP server
Go
7
star
28

jrvs.io

๐Ÿ”— Personal URL shortener
Shell
6
star
29

docker-lamp-php5

Legacy LAMP image with PHP 5.6 (EOL) & MySQL 5.7 on Ubuntu 16.04 Xenial. ๐Ÿšจ Use at your own risk!
Shell
5
star
30

candies

๐Ÿญ๐Ÿฌ Scrabble's flavo[u]r of @candybox2's delicious ฤame ๐Ÿฌ๐Ÿญ
JavaScript
4
star
31

careful-downloader

๐Ÿ•ต๏ธโ€โ™€๏ธ Downloads a file and its checksums, validates the hash, and optionally extracts it if safe.
JavaScript
4
star
32

spoons

๐Ÿฅ„ Online manager for offline spooning, for and by iD Tech Camps at Princeton University ๐Ÿฏ
HTML
4
star
33

docker-tor

๐Ÿง… A very simple Docker image that runs the Tor daemon
Dockerfile
4
star
34

tor-proxy-node

[๐Ÿšง VERY WIP] Quickly serve up a Tor proxy of your static clearnet site
JavaScript
3
star
35

stitches-normalize

๐Ÿงต @sindresorhus's modern-normalize.css as a plug-and-play JavaScript object compatible with Stitches.
TypeScript
3
star
36

dark-mode-example

๐ŸŒ“ Simple dark mode switching using local storage, OS preference detection, and minimal JavaScript
JavaScript
3
star
37

twemoji-emojis

๐Ÿ“ฆ A very simple NPM package that downloads Twemoji emojis (PNG and SVG)
JavaScript
3
star
38

imagemoji

๐Ÿ–ผ๏ธ Replaces emojis in strings or DOM nodes with corresponding images
TypeScript
3
star
39

hugo-uno

Personal Hugo boilerplate with Node, PostCSS, Autoprefixer, Netlify, etc.
HTML
2
star
40

website-stats

๐Ÿ“ˆ Daily snapshots of my website's hit counter data
JavaScript
2
star
41

comp40

COMP 40 at Tufts CS โ€“ย Machine Structure & Assembly Language Programming
C
2
star
42

phood

Photos of nearby phood. Group project for COMP 20 @tuftsdev, abandoned as of Spring 2015.
JavaScript
2
star
43

get-canonical-url

๐Ÿ”— Determines the current page's canonical URL and optionally normalizes it for consistency.
TypeScript
2
star
44

synonyms-for-awesome

๐Ÿ‘ฉโ€๐Ÿซ Making adjectives meritorious, exemplary, and supercalifragilisticexpialidocious again.โ„ข
HTML
2
star
45

homelab

๐Ÿงช Docker Compose service definitions for the various apps I have running on my home network.
2
star
46

simple-anchor

๐Ÿ”— A bare-bones fork of AnchorJS.
JavaScript
2
star
47

hass-config

My personal Home Assistant configuration ๐Ÿก
Python
1
star
48

dmnsrch.mobi

Quickly check domain name availability from your mobile device.
PHP
1
star
49

onlinenow

Facebook app that displays your online friends while you stay offline and invisible.
JavaScript
1
star
50

my-first-website

<marquee>My terrible, horrible, no good, very bad first website, circa 2001. ๐Ÿ‘ถ๐Ÿป</marquee>
HTML
1
star
51

JoeyTracker

iOS app for tracking shuttle buses at Tufts University. Abandoned as of 2016.
Objective-C
1
star
52

rsa-locksmith

Teeny tiny script to brute-force passphrases of RSA private keys ๐Ÿ”‘
Shell
1
star
53

jbb

A PHP bulletin board creatively titled Jake's Bulletin Board, circa 2003. (My first full coding project ever โ€“ย complete with bugs and security holes and horrendous style!)
PHP
1
star
54

jarv.is-hugo

Archived Hugo version of https://jarv.is/
JavaScript
1
star
55

vercel-esm-import-bug

TypeScript
1
star
56

node-module-template

Just a personal NPM/browser module boilerplate to my liking, probably not very useful to anybody else. ๐Ÿ˜Š
TypeScript
1
star