Skip to content

rename default branch to main #106

rename default branch to main

rename default branch to main #106

Workflow file for this run

name: mambabuild
on:
push:
branches:
- main
env:
atoken: ${{ secrets.ANACONDA_UPLOAD_TOKEN }}
recipe_path: conda/recipe
env_yml_path: conda/env/yml
VERSION: '1.0.1.9016' # versioned by bump2version
jobs:
build_conda_pkgs:
# When merging to one of the branches above and the commit message matches
if: "startsWith(github.event.head_commit.message, 'Bump version:')"
name: Build conda package
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Micromamba setup
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ${{ env.env_yml_path }}/condabuild_env.yml
- name: 🐍 Conda pkg build and upload
run: |
conda mambabuild ${recipe_path}/cpsr -c pcgr -c conda-forge -c bioconda --token ${atoken}
- name: 🔖 Tag creation
uses: actions/github-script@v7
with:
script: |
const the_tag_name = 'refs/tags/v' + process.env.VERSION
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: the_tag_name,
sha: context.sha
})
pkgdown_site:
# only build pkgdown site on main
if: github.ref_name == 'main'
name: Deploy pkgdown website
runs-on: ubuntu-latest
needs: build_conda_pkgs
defaults:
run:
shell: bash -l {0}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Micromamba setup
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ${{ env.env_yml_path }}/pkgdown.yml
- name: Publish pkgdown website
run: |
git config --local user.email "actions@github.com"
git config --local user.name "GitHub Actions"
micromamba activate pkgdown
printf "cpsr version:\n"
Rscript -e "packageVersion('cpsr')"
Rscript -e "pkgdown::deploy_to_branch(pkg = '.', commit_message = 'Built CPSR website: https://sigven.github.io/cpsr/', branch = 'gh-pages', new_process = FALSE)"