From 4af339ab934bab9a18d6d87310072984c3d2cec1 Mon Sep 17 00:00:00 2001 From: Anders Nickelsen Date: Tue, 29 Aug 2023 19:38:29 +0200 Subject: [PATCH] CI --- .github/workflows/ci.yml | 25 +++++++++++++++++++++++++ _config.yml | 2 +- deploy.sh | 6 +++--- 3 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..905cb24 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,25 @@ +name: CI +on: + push: + secrets: + AWS_ACCESS_KEY_ID: + required: true + AWS_SECRET_ACCESS_KEY: + required: true + BUCKET: + required: true + DISTRIBUTION_ID: + required: true +jobs: + deploy: + runs-on: ubuntu-latest + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + BUCKET: ${{ secrets.BUCKET }} + DISTRIBUTION_ID: ${{ secrets.DISTRIBUTION_ID }} + steps: + - name: Check out repository code + uses: actions/checkout@v3 + - run: build.sh + #- run: deploy.sh \ No newline at end of file diff --git a/_config.yml b/_config.yml index c0ec66d..0d442a0 100644 --- a/_config.yml +++ b/_config.yml @@ -1,7 +1,7 @@ title: Dag- og aftenskolen i Rønde email: info@dag-aftenskolen.dk baseurl: "" # the subpath of your site, e.g. /blog -url: "http://dag-aftenskolen.dk" # the base hostname & protocol for your site, e.g. http://example.com +url: "https://dag-aftenskolen.dk" # the base hostname & protocol for your site, e.g. http://example.com exclude: [build.sh, deploy.sh, serve.sh, README.md, Gemfile, Gemfile.lock] # Build settings diff --git a/deploy.sh b/deploy.sh index 287b42e..aab00f3 100755 --- a/deploy.sh +++ b/deploy.sh @@ -1,5 +1,5 @@ #!/bin/sh -aws s3 sync _site/ s3://dag-aftenskolen.dk --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://dag-aftenskolen.dk/assets/css/main-2019.css --content-type="text/css" $@ -aws cloudfront create-invalidation --distribution-id EO900804BMV13 --paths /\* $@ +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 /\* $@