Skip to content

Commit

Permalink
publish to s3
Browse files Browse the repository at this point in the history
  • Loading branch information
edavidaja committed May 17, 2024
1 parent 7a49a2a commit 55aadc8
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Quarto Publish to docs.posit.co

on:
workflow_dispatch:
push:
branches: main

permissions:
id-token: write
contents: read

jobs:
build-deploy:
runs-on: ubuntu-latest
steps:
- name: Configure AWS credentials
id: creds
uses: aws-actions/configure-aws-credentials@master
with:
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
aws-region: ${{ secrets.AWS_REGION }}

- name: Check out repository
uses: actions/checkout@v4

- name: install Just
uses: extractions/setup-just@v2

- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2
with:
version: pre-release

- name: Render Quarto Project
uses: quarto-dev/quarto-actions/render@v2

- run: just push-docs

14 changes: 14 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,17 @@ test-connect-interpreter-versions:
docker run --rm $image /bin/bash -c "command -v $ex"
done
done

push-docs:
#!/usr/bin/env bash
set -euxo pipefail
s3_args=(--dryrun)
if [[ "${GITHUB_REF:-}" == "refs/heads/main" ]] || [[ "${GITHUB_REF:-}" =~ ^refs/tags/v[0-9]{4}\.[0-9]{2}\.[0-9]+$ ]]; then
s3_args=("")
fi

# The s3 bucket is s3://docs.rstudio.com/, which is available as https://docs.posit.co/
aws s3 sync ${s3_args[*]:-} \
_site \
"s3://docs.rstudio.com/helm/"

0 comments on commit 55aadc8

Please sign in to comment.