Skip to content

Commit

Permalink
CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Anders Nickelsen committed Aug 29, 2023
1 parent 1e34e86 commit 4af339a
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 4 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
title: Dag- og aftenskolen i Rønde
email: [email protected]
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
Expand Down
6 changes: 3 additions & 3 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -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 /\* $@

0 comments on commit 4af339a

Please sign in to comment.