Add Forgejo self-clone fallback for workflow source
Some checks failed
Deploy Hello Lambda CFT / deploy (push) Failing after 2s
Some checks failed
Deploy Hello Lambda CFT / deploy (push) Failing after 2s
This commit is contained in:
parent
bb93c22586
commit
e8234e5e12
1 changed files with 11 additions and 7 deletions
|
|
@ -15,14 +15,18 @@ jobs:
|
|||
AWS_DEFAULT_REGION: ${{ secrets.LOWER }}
|
||||
|
||||
steps:
|
||||
- name: Verify workspace
|
||||
- name: Prepare source
|
||||
run: |
|
||||
pwd
|
||||
ls -la
|
||||
set -e
|
||||
SRC_DIR="."
|
||||
if [ ! -f "infra/hello-lambda.yml" ]; then
|
||||
echo "infra/hello-lambda.yml not found in runner workspace"
|
||||
exit 1
|
||||
echo "Repository files not present in workspace. Cloning from Forgejo..."
|
||||
git clone --depth 1 "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" _src
|
||||
SRC_DIR="_src"
|
||||
fi
|
||||
[ -f "${SRC_DIR}/infra/hello-lambda.yml" ] || { echo "infra/hello-lambda.yml not found"; exit 1; }
|
||||
echo "SRC_DIR=${SRC_DIR}" >> "$GITHUB_ENV"
|
||||
echo "Using source directory: ${SRC_DIR}"
|
||||
|
||||
- name: Ensure AWS CLI
|
||||
run: |
|
||||
|
|
@ -54,11 +58,11 @@ jobs:
|
|||
- name: Validate CFT
|
||||
run: |
|
||||
aws cloudformation validate-template \
|
||||
--template-body file://infra/hello-lambda.yml
|
||||
--template-body "file://${SRC_DIR}/infra/hello-lambda.yml"
|
||||
|
||||
- name: Deploy CFT
|
||||
run: |
|
||||
aws cloudformation deploy \
|
||||
--stack-name hello-lambda-stack \
|
||||
--template-file infra/hello-lambda.yml \
|
||||
--template-file "${SRC_DIR}/infra/hello-lambda.yml" \
|
||||
--capabilities CAPABILITY_NAMED_IAM
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue