-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (66 loc) · 2.15 KB
/
conda_env.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
70
71
72
73
74
75
76
name: Conda Env Workflow
on:
push:
branches:
- master
- fix_ci_cd
permissions:
id-token: write
contents: read
jobs:
create-conda-env:
runs-on: ubuntu-22.04
env:
AWS_DEFAULT_REGION: eu-west-1
container:
image: amazonlinux:2
steps:
- name: Install tar (for code checkout)
run: yum install -y tar gzip
- name: Checkout Code
uses: actions/checkout@v3 # Checks out the repository under $GITHUB_WORKSPACE.
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16' # Use a stable, compatible version
- name: Setup conda
uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
activate-environment: pheno
python-version: 3.11
environment-file: environment.yml
- name: Install pheno-utils
shell: bash -el {0}
run: |
cd $GITHUB_WORKSPACE
pip install . # Install pheno-utils from the current directory
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: ${{ env.AWS_DEFAULT_REGION }}
- 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-%H-%S)
BRANCH=${GITHUB_REF#refs/heads/}
BRANCH=${BRANCH//\//_} # Replace / with _ in branch name
aws s3 cp $HOME/pheno.tar.gz "s3://pheno-ds-github-cicd-${{ env.AWS_DEFAULT_REGION }}/conda_envs/${BRANCH}_${DATE}.tar.gz"