Skip to content

Deploy site to AWS S3 production bucket #25

Deploy site to AWS S3 production bucket

Deploy site to AWS S3 production bucket #25

Workflow file for this run

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# Sample workflow for building and deploying a Jekyll site to AWS S3
name: Deploy site to AWS S3 production bucket
on:
# Manually run the deployment
workflow_dispatch
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: 'us-west-1'
jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "2.6.5" # Not needed with a .ruby-version file
- name: "Bundle install"
run: bundle install
- name: "Build Site"
run: JEKYLL_ENV=production bundle exec jekyll build --config _config.yml
- name: "Deploy to AWS S3"
run: aws s3 sync ./_site/ s3://vocabulary-uncefact-sam-private/D22B --delete --cache-control max-age=604800
- name: "Create CloudFront invalidation"
run: aws cloudfront create-invalidation --distribution-id "E1RCVDSPUMB7H2" --paths "/D22B/*"