Bump version: 0.4.12 → 0.4.13 #9
Workflow file for this run
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: conda-docker-docs | |
on: | |
push: | |
branches: | |
- conda | |
env: | |
atoken: ${{ secrets.ANACONDA_UPLOAD_TOKEN }} | |
recipe_path: deploy/conda/recipe | |
env_yaml_path: deploy/conda/env/yaml | |
env_lock_path: deploy/conda/env/lock | |
VERSION: '0.4.13' # versioned by bump2version | |
jobs: | |
condarise-dockerise-document: | |
# When merging to main and the commit message starts with 'Bump version:' | |
if: "startsWith(github.event.head_commit.message, 'Bump version:')" | |
name: Conda Docker Docs | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- name: Code checkout | |
uses: actions/checkout@v3 | |
- name: Miniconda setup | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
auto-update-conda: true | |
add-pip-as-python-dependency: false # conda-lock goes crazy if pip pre-installed | |
activate-environment: env1 | |
miniforge-variant: Mambaforge | |
miniforge-version: "latest" | |
channels: "umccr,bioconda,conda-forge" | |
- name: 🐍 Conda pkg build and upload | |
run: | | |
conda activate | |
mamba create --name cbuildenv conda-build conda-verify anaconda-client boa | |
conda activate cbuildenv | |
conda mambabuild --R 4.2 ${recipe_path} --token ${atoken} | |
- name: 🔒 Conda lock | |
run: | | |
conda activate | |
mamba create --name lockenv conda-lock==2.1.0 pip | |
conda activate lockenv | |
conda-lock --file ${env_yaml_path}/rnasum.yaml --platform linux-64 --no-mamba | |
mv conda-lock.yml ${env_lock_path}/conda-lock.yml | |
- name: 💾 Commit lockfile | |
run: | | |
git status | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Actions" | |
MSG="[bot] Updating conda-lock file (v${VERSION})" | |
git add . | |
git commit -m "${MSG}" | |
git push | |
- name: 🌐 Website publish | |
run: | | |
conda activate | |
mamba env create -n pkgdownenv -f ${env_yaml_path}/pkgdown.yaml | |
conda activate pkgdownenv | |
rnasum.R --version | |
Rscript -e "pkgdown::deploy_to_branch(pkg = '.', commit_message = paste(pkgdown:::construct_commit_message('.'), '- see https://umccr.github.io/rnasum/'), branch = 'gh-pages', new_process = FALSE)" | |
- name: 📥 Pull lock commit | |
id: pull_lock_commit | |
run: | | |
git pull --no-rebase | |
git --no-pager log --decorate=short --pretty=oneline -n3 | |
LATEST_COMMIT_HASH="$(git --no-pager log -1 --format='%H')" | |
echo "latest_commit_hash=${LATEST_COMMIT_HASH}" >> $GITHUB_OUTPUT | |
- name: 🔖 Create tag | |
uses: actions/github-script@v6 | |
env: | |
LATEST_COMMIT_HASH: ${{ steps.pull_lock_commit.outputs.latest_commit_hash }} | |
with: | |
script: | | |
const the_tag_name = 'refs/tags/v' + process.env.VERSION | |
const the_sha = process.env.LATEST_COMMIT_HASH | |
github.rest.git.createRef({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
ref: the_tag_name, | |
sha: the_sha | |
}) | |
# work with tag from above | |
- name: Code checkout | |
uses: actions/checkout@v3 | |
with: | |
ref: v${{ env.VERSION }} | |
- name: 🏰 QEMU setup | |
uses: docker/setup-qemu-action@v2 | |
- name: 🏯 Buildx setup | |
uses: docker/setup-buildx-action@v2 | |
with: | |
install: true | |
config-inline: | | |
[worker.oci] | |
max-parallelism = 2 | |
- name: 🐙 GitHub CR login | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: 🐳 Docker img build and push | |
uses: docker/build-push-action@v3 | |
with: | |
tags: ghcr.io/${{ github.repository }}:${{ env.VERSION }} | |
context: . | |
push: true | |
platforms: linux/amd64 | |