clean up project #275
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Site | |
on: | |
push: | |
paths: | |
- site/** | |
- .github/workflows/site.yaml | |
jobs: | |
docs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Deploy Prepare | |
run: | | |
echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV | |
echo "DEPLOY_URL=" >> $GITHUB_ENV | |
- name: Deploy Commit | |
run: | | |
echo "SHORT_SHA=${SHORT_SHA}" | |
echo "DEPLOY_URL=commits/${SHORT_SHA}/" >> $GITHUB_ENV | |
if: github.ref != 'refs/heads/main' | |
- name: Deploy URL | |
run: echo "DEPLOY_URL=${DEPLOY_URL}" | |
- uses: quarto-dev/quarto-actions/setup@v2 | |
- uses: actions/checkout@v2 | |
- uses: r-lib/actions/setup-pandoc@v2 | |
- uses: r-lib/actions/setup-r@v2 | |
with: | |
use-public-rspm: true | |
- name: Install Quarto Deps | |
run: | | |
Rscript -e 'install.packages(c("rmarkdown", "reticulate"))' | |
working-directory: ./r | |
- name: Render quarto | |
run: quarto render | |
working-directory: ./site | |
- name: Add Commit SHA | |
run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV | |
- uses: zdurham/s3-upload-github-action@master | |
with: | |
args: --recursive --acl public-read | |
env: | |
FILE: './site/_site' | |
AWS_REGION: 'us-west-2' | |
S3_BUCKET: 'notebooks.hal9.com' | |
S3_KEY: ${{ env.DEPLOY_URL }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
- uses: LouisBrunner/[email protected] | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
name: preview | |
conclusion: ${{ job.status }} | |
action_url: ${{ format('https://s3.amazonaws.com/notebooks.hal9.com/{0}index.html', env.DEPLOY_URL) }} | |
details_url: ${{ format('https://s3.amazonaws.com/notebooks.hal9.com/{0}index.html', env.DEPLOY_URL) }} | |
output: "{ \"summary\": \"${{ format('https://s3.amazonaws.com/notebooks.hal9.com/{0}index.html', env.DEPLOY_URL) }}\" }" |