Build Lithops images for every push to main #3
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: Lithops images | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
defaults: | |
# Required shell entrypoint to have properly activated conda environments | |
run: | |
shell: bash -l {0} | |
jobs: | |
test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ["ubuntu-latest"] | |
python-version: ["3.11"] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Copy lithops configuration templates | |
run: | | |
cp $GITHUB_WORKSPACE/.github/workflows/.lithops_config_gcp.template $GITHUB_WORKSPACE/.github/workflows/.lithops_config_gcp | |
- name: Google auth | |
id: 'auth' | |
uses: 'google-github-actions/auth@v2' | |
with: | |
credentials_json: '${{ secrets.GOOGLE_CREDENTIALS }}' | |
create_credentials_file: true | |
- name: Configure lithops GCP | |
uses: microsoft/variable-substitution@v1 | |
with: | |
files: ${{ github.workspace }}/.github/workflows/.lithops_config_gcp | |
env: | |
gcp.credentials_path: ${{ steps.auth.outputs.credentials_file_path }} | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
architecture: x64 | |
- name: Install | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install -r ci/requirements-lithops-gcp.txt | |
- name: Build and deploy images | |
env: | |
LITHOPS_CONFIG_FILE: ${{ github.workspace }}/${{ matrix.lithops-config }} | |
run: | | |
lithops runtime build -f ci/requirements-lithops-gcp.txt cubed-runtime-main -b gcp_functions | |
lithops runtime deploy -b gcp_functions --memory 2048 cubed-runtime-main |