Skip to content

Merge pull request #227 from Australian-Imaging-Service/smriprep-and-… #49

Merge pull request #227 from Australian-Imaging-Service/smriprep-and-…

Merge pull request #227 from Australian-Imaging-Service/smriprep-and-… #49

Workflow file for this run

# This workflows will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
name: Build release
on:
push:
branches: [ main, develop ]
tags: [ '*' ]
pull_request:
branches: [ main, develop ]
workflow_dispatch: # Allow manual triggering by a user with write access to this repo
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Removed unnecessary tools to free space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Checkout
uses: actions/checkout@v2
- name: Get release tag
run: |
git fetch --prune --unshallow
echo "RELEASE=`echo $(git describe --tags --abbrev=0)`" >> $GITHUB_ENV
- name: Unset header
# checkout@v2 adds a header that makes branch protection report errors
# because the Github action bot is not a collaborator on the repo
run: git config --local --unset http.https://github.com/.extraheader
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.11'
- name: Update build tools
run: python -m pip install --upgrade pip
- name: Install dependencies
run: pip install -r requirements.txt
- uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }} # - must be in GitHub Secrets!
- name: Check for tagged release
id: deployable
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
run: echo "PUSH='--push'"
- name: Build and push container images
env:
PUSH: "${{ steps.deployable.outputs.PUSH }}"
run: >
arcana deploy make-app ./australian-imaging-service xnat:XnatApp
--registry ghcr.io --check-registry --clean-up --tag-latest --loglevel info
--release pipelines-metapackage $RELEASE $PUSH