Skip to content

Copy favicon to deployed site #10

Copy favicon to deployed site

Copy favicon to deployed site #10

Workflow file for this run

# Workflow derived from https://github.com/posit-dev/r-shinylive/tree/actions-v1/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
#
# Basic example of a GitHub Actions workflow that builds a Shiny app and deploys
# it to GitHub Pages.
name: Deploy app to gh-pages
on:
# Manually trigger the workflow
workflow_dispatch:
# Trigger on push to `master` branch
push:
branches: ["master"]
# Trigger on pull request to all branches (but do not deploy to gh-pages)
pull_request:
jobs:
build:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
steps:
- uses: actions/checkout@v4
- uses: rstudio/shiny-workflows/setup-r-package@v1
with:
packages: |
shinylive
sessioninfo
cache-version: ${{ github.event.inputs.cache-version }}
- name: Build site
shell: Rscript {0}
run: |
shinylive::export(
".", "site", wasm_packages = FALSE, package_cache = FALSE,
template_params = list(title = "IncomeExplorer",
include_in_head = '<link rel="shortcut icon" href="favicon.ico" />')
)
- name: Copy favicon to site
shell: Rscript {0}
run: |
file.copy("www/favicon.ico", "site/favicon.ico")
- name: Upload site artifact
if: github.ref == 'refs/heads/master'
uses: actions/upload-pages-artifact@v3
with:
path: "site"
deploy:
if: github.ref == 'refs/heads/master'
needs: build
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4