GitHub Action and Docker container to run s3_website
This container has been published to Docker Hub and can be used as a container. To run it, you'd run something like:
docker run --rm -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY
-e S3_BUCKET -e AWS_CLOUDFRONT_DISTRIBUTION --mount type=bind,source="$(pwd)",target=/site,readonly
justinharringa/s3_website push --site _site
If you don't pass any arguments you'll see the equivalent of s3_website help
. Note that you'll mount
your host location into /site
and will also need to pass in any environment variables that your
s3_website.yml
or s3_website
itself requires.
Docker Hub - justinharringa/s3_website
The following example uses this GitHub Action to push the contents of the build
folder to an
S3 bucket and update a CloudFront distribution. It still requires that you provide an s3_website.yml
such as s3_website.yml.
- name: Deploy
uses: docker://justinharringa/s3_website:master
with:
args: 'push --site build'
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
S3_BUCKET: ${{ secrets.S3_BUCKET }}
AWS_CLOUDFRONT_DISTRIBUTION: ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION }}
I have been using s3_website for quite some time and it works great (huge thanks to Lauri Lehmijoki / Philippe Creux!!). I am giving GitHub Actions a shot and want to use s3_website within a Docker container both in GitHub Actions and also for some other workflows where I don't really want to have to worry about making sure the Java/Ruby bits are correct and available. Thus far, this seems to work out quite well. Ideally, I'd like to contribute the Dockerfile to s3_website.