From c356301b54797ab072334ac9f7545e5b1a8fe08e Mon Sep 17 00:00:00 2001 From: Kseniya Shychko Date: Sun, 3 Mar 2024 10:46:37 +0100 Subject: [PATCH] fix: s3 sync path --- .github/workflows/preview-untp-pages.yml | 48 ++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/preview-untp-pages.yml diff --git a/.github/workflows/preview-untp-pages.yml b/.github/workflows/preview-untp-pages.yml new file mode 100644 index 000000000..6a2261d9a --- /dev/null +++ b/.github/workflows/preview-untp-pages.yml @@ -0,0 +1,48 @@ +# 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 preview to AWS S3 (untp-pages) + +on: + push: + branches: + - untp-pages + +# 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: bundle exec jekyll build --config _config_preview.yml + - name: "Deploy to AWS S3" + run: | + aws s3 sync ./_site/ s3://uncefact-vocab-preview-sam-bucket-private/vocabulary/untp --cache-control max-age=604800 + aws cloudfront create-invalidation --distribution-id "E32QP2QS6SXRHC" --paths "/vocabulary/untp/te/*" \ No newline at end of file