diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9e9cfe0..00c77d5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,5 +21,19 @@ jobs: steps: - name: Check out repository code uses: actions/checkout@v3 - - run: ./build.sh - #- run: ./deploy.sh \ No newline at end of file + - name: Build + run: | + docker run \ + -v ${{ github.workspace }}:/srv/jekyll -v ${{ github.workspace }}/_site:/srv/jekyll/_site \ + jekyll/jekyll:3.8 /bin/bash -c "chmod -R 777 /srv/jekyll && jekyll build" + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v3 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: eu-west-1 + - name: Deploy + run: | + aws s3 sync _site/ s3://$BUCKET --content-type "text/html; charset=utf-8" --delete --cache-control "max-age=0" --exclude "*.sh" + aws s3 cp _site/assets/css/main-2019.css s3://$BUCKET/assets/css/main-2019.css --content-type="text/css" + aws cloudfront create-invalidation --distribution-id $DISTRIBUTION_ID --paths /\*