-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (59 loc) · 1.83 KB
/
liat.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
65
66
67
68
69
name: Liat Workflow
on:
push:
branches:
- liats/wip/ci_cd
permissions:
id-token: write
contents: read
jobs:
create-conda-env:
runs-on: ubuntu-latest
container:
image: amazonlinux:2
steps:
# Install tar and gzip for code checkout
- name: Install tar
run: yum install -y tar gzip
- name: Checkout Code
uses: actions/checkout@v3 # Checks out the repository under $GITHUB_WORKSPACE.
- name: Setup conda
uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
activate-environment: pheno
python-version: 3.11
# environment-file: etc/example-environment.yml
- name: Install pheno-utils
shell: bash -el {0}
run: |
cd $GITHUB_WORKSPACE
pip install .
conda list
- name: Pack Conda
shell: bash -el {0}
run: |
# Enable adding the kernel to JupyterLab
pip install -q ipykernel
python -m ipykernel install --user --name pheno --display-name "Pheno"
pip install -q conda-pack
conda pack --quiet -n pheno -o $HOME/pheno.tar.gz
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: arn:aws:iam::081569964966:role/github_cicd
aws-region: eu-west-1
- name: Setup AWS CLI
run: |
yum install -y unzip > /dev/null
echo "Installing AWS CLI"
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
./aws/install
aws --version
- name: Upload to S3
run: |
echo "Uploading artifact to S3"
DATE=$(date +%Y-%m-%d)
BRANCH=${GITHUB_REF#refs/heads/}
aws s3 cp $HOME/pheno.tar.gz s3://pheno-ds-github/conda_envs/pheno_${BRANCH}_${DATE}.tar.gz