GITBOOK-168: change request with no subject merged in GitBook #49
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: patoloji-hakkinda | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
render: | |
if: "!contains(github.event.head_commit.message, 'WIP')" | |
runs-on: ubuntu-latest | |
continue-on-error: true | |
env: | |
RENV_PATHS_ROOT: ~/.local/share/renv | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- name: "actions checkout" | |
uses: actions/checkout@v3 | |
- name: "Install curl for Bioconductor" | |
run: | | |
sudo apt -y install libcurl4-openssl-dev | |
- uses: r-lib/actions/setup-r@v2 | |
- uses: r-lib/actions/setup-renv@v2 | |
- name: Install Pandoc | |
run: sudo apt-get install pandoc | |
- name: Restore R package cache | |
uses: actions/cache@v2 | |
with: | |
path: ${{ env.R_LIBS_USER }} | |
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} | |
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- | |
- name: Install R dependencies | |
run: | | |
if (!requireNamespace("remotes", quietly = TRUE)) {install.packages("remotes", dependencies = TRUE, quiet = TRUE, verbose = FALSE)} | |
remotes::install_deps(dependencies = TRUE) | |
if (!requireNamespace("renv", quietly = TRUE)) install.packages("renv", dependencies = TRUE, quiet = TRUE, verbose = FALSE) | |
renv::restore() | |
if (!requireNamespace("fs", quietly = TRUE)) install.packages("fs", dependencies = TRUE, quiet = TRUE, verbose = FALSE) | |
if (!requireNamespace("quarto", quietly = TRUE)) install.packages("quarto", dependencies = TRUE, quiet = TRUE, verbose = FALSE) | |
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) | |
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") | |
shell: Rscript {0} | |
- name: "Render patoloji-hakkinda" | |
shell: Rscript {0} | |
run: | | |
filestorender <- list.files(path = '.', pattern = '.md', full.names = TRUE, recursive = TRUE) | |
render_file <- purrr::safely(function(file) {rmarkdown::render(file, encoding = 'UTF-8', output_dir = './patoloji-hakkinda/')}) | |
purrr::map(.x = filestorender, .f = render_file) | |
- name: Commit results to main branch | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Actions" | |
git add . | |
git commit -m "CI added changes `date +'%Y-%m-%d %H:%M:%S'`" || echo "No changes to commit" | |
git push origin || echo "No changes to commit" | |
- name: Push changes # push the output folder to your repo | |
uses: ad-m/github-push-action@master | |
with: | |
branch: main | |
github_token: ${{ secrets.API_TOKEN_GITHUB }} | |
# WORKFLOW_GITHUB_TOKEN | |
force: true | |
patoloji-hakkinda: | |
needs: render | |
continue-on-error: true | |
runs-on: ubuntu-latest | |
container: ubuntu | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Pushes to patoloji-hakkinda | |
uses: cpina/github-action-push-to-another-repository@main | |
env: | |
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }} | |
with: | |
source-directory: './patoloji-hakkinda' | |
destination-github-username: 'sbalci' | |
destination-repository-name: 'patoloji-hakkinda' | |
user-email: [email protected] | |
target-branch: main | |
# build: | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/checkout@v2 | |
# - name: Build the site in the jekyll/builder container | |
# run: | | |
# docker run \ | |
# -v ${{ github.workspace }}:/srv/jekyll -v ${{ github.workspace }}/_site:/srv/jekyll/_site \ | |
# jekyll/builder:latest /bin/bash -c "chmod -R 777 /srv/jekyll && jekyll build --future" | |
# tweet: | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Get current date | |
# id: date | |
# run: echo "::set-output name=date::$(date +'%Y-%m-%d')" | |
# - uses: ethomson/send-tweet-action@v1 | |
# with: | |
# status: (Para)Pathology notes are updated on ${{ steps.date.outputs.date }}. See here https://www.parapathology.com/ and here https://www.patolojinotlari.com/ | |
# consumer-key: ${{ secrets.API_KEY }} | |
# consumer-secret: ${{ secrets.API_SECRET_KEY }} | |
# access-token: ${{ secrets.ACCESS_TOKEN }} | |
# access-token-secret: ${{ secrets.ACCESS_TOKEN_SECRET }} | |