diff --git a/.github/workflows/production.yml b/.github/workflows/production.yml new file mode 100644 index 0000000..20a775c --- /dev/null +++ b/.github/workflows/production.yml @@ -0,0 +1,42 @@ +name: Deploy + +on: + push: + branches: + - 'master' + +permissions: + id-token: write + contents: read + +jobs: + + build: + name: Build + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Setup python + uses: actions/setup-python@v4 + with: + python-version: '3.x' + + - name: Build mkdocs + run: | + pip install mkdocs-material mkdocs-material-extensions + mkdocs -q build + + - name: Configure AWS Credentials with OIDC + uses: aws-actions/configure-aws-credentials@v1 + with: + role-to-assume: arn:aws:iam::167422901596:role/gha_nocontent + aws-region: "eu-central-1" + + - name: Upload docs + run: | + aws s3 sync --delete .docs/ s3://nocontent.xyz/ + + - name: Invalidate Cloudfront + run: aws cloudfront create-invalidation --distribution-id "E1TX7G3VGQGAF4" --path "/*" diff --git a/.gitignore b/.gitignore index ed926a0..feb9196 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ nocontent .direnv +.docs \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index 62be6c6..73a025b 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -7,6 +7,7 @@ extra_css: - stylesheets/codemonauts.css theme: name: material + font: false logo: logo.svg favicon: favicon.png icon: