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 }}
|
AWS_DEFAULT_REGION: ${{ secrets.LOWER }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Verify workspace
|
- name: Prepare source
|
||||||
run: |
|
run: |
|
||||||
pwd
|
set -e
|
||||||
ls -la
|
SRC_DIR="."
|
||||||
if [ ! -f "infra/hello-lambda.yml" ]; then
|
if [ ! -f "infra/hello-lambda.yml" ]; then
|
||||||
echo "infra/hello-lambda.yml not found in runner workspace"
|
echo "Repository files not present in workspace. Cloning from Forgejo..."
|
||||||
exit 1
|
git clone --depth 1 "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" _src
|
||||||
|
SRC_DIR="_src"
|
||||||
fi
|
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
|
- name: Ensure AWS CLI
|
||||||
run: |
|
run: |
|
||||||
|
|
@ -54,11 +58,11 @@ jobs:
|
||||||
- name: Validate CFT
|
- name: Validate CFT
|
||||||
run: |
|
run: |
|
||||||
aws cloudformation validate-template \
|
aws cloudformation validate-template \
|
||||||
--template-body file://infra/hello-lambda.yml
|
--template-body "file://${SRC_DIR}/infra/hello-lambda.yml"
|
||||||
|
|
||||||
- name: Deploy CFT
|
- name: Deploy CFT
|
||||||
run: |
|
run: |
|
||||||
aws cloudformation deploy \
|
aws cloudformation deploy \
|
||||||
--stack-name hello-lambda-stack \
|
--stack-name hello-lambda-stack \
|
||||||
--template-file infra/hello-lambda.yml \
|
--template-file "${SRC_DIR}/infra/hello-lambda.yml" \
|
||||||
--capabilities CAPABILITY_NAMED_IAM
|
--capabilities CAPABILITY_NAMED_IAM
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue