Skip to content

.github/workflows/installer.yaml #11

.github/workflows/installer.yaml

.github/workflows/installer.yaml #11

Workflow file for this run

on:
push:
branches:
- installer
workflow_dispatch:
jobs:
doIt:
runs-on: ubuntu-latest
permissions:
contents: "read"
id-token: "write"
steps:
- name: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
# ref: ${{ github.head_ref }}
- name: setupPython
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: setupSam
uses: aws-actions/setup-sam@v2
with:
use-installer: true
token: ${{ secrets.GITHUB_TOKEN }}
- name: getCreds
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: "arn:aws:iam::934778205429:role/jaxGithubActionsRole"
aws-region: us-east-2
- name: runTests
run: |
pip install -r lambda/tests/requirements.txt
PYTHONPATH=${GITHUB_WORKSPACE}/lambda/src/common/python:$PYTHONPATH pytest -s -vvv lambda/tests/
- name: installCore
id: install-core
run: |
ls -la .git/refs/tags
export SOURCE_VERSION=$(git describe --tags)
export UNIQIFIER=$(date | md5sum | head -c 16)
echo $SOURCE_VERSION
echo $UNIQIFIER
sam build -b ./build -s . -t cloudformation/bc_core.yaml
sam deploy \
--template-file build/template.yaml \
--stack-name bayerclaw2-core \
--resolve-s3 \
--capabilities CAPABILITY_NAMED_IAM \
--no-fail-on-empty-changeset \
--parameter-overrides \
RootVolumeSize=50 \
ScratchVolumeSize=100 \
SourceVersion=${SOURCE_VERSION} \
Subnets="subnet-3ffe7854,subnet-b3b296ff,subnet-e1c63a9c" \
Uniqifier=${UNIQIFIER} \
VpcId="vpc-00cb556b"
echo "runner_image_tag=$(aws cloudformation describe-stacks --query "Stacks[?StackName=='bayerclaw2-core'][].Outputs[?OutputKey=='RunnerImageUri'].OutputValue" --output text)" >> $GITHUB_OUTPUT
- name: loginToEcr
id: login-to-ecr
uses: aws-actions/amazon-ecr-login@v2
- name: buildRunner
working-directory: bclaw_runner
env:
DOCKER_BUILDKIT: 1
RUNNER_IMAGE_TAG: ${{ steps.install-core.outputs.runner_image_tag }}
run: |
docker build --target test -f Dockerfile.alpine "."
docker build --target build -t ${RUNNER_IMAGE_TAG} -f Dockerfile.alpine "."
docker push ${RUNNER_IMAGE_TAG} || true