-
Notifications
You must be signed in to change notification settings - Fork 3
64 lines (52 loc) · 2.04 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# 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