Skip to content

Commit

Permalink
/deploy sit
Browse files Browse the repository at this point in the history
  • Loading branch information
sliu008 committed Jan 7, 2025
1 parent 018fbed commit 88d0cf6
Showing 1 changed file with 25 additions and 4 deletions.
29 changes: 25 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -236,16 +236,37 @@ jobs:
type=semver,pattern={{raw}},value=${{ needs.build.outputs.version }}
type=raw,value=${{ env.TARGET_ENV_LOWERCASE }}
- name: Set Build Source
id: set-source
run: |
# Default build source for standard branches
echo "SOURCE=${{ env.pyproject_name }}==${{ env.the_version }}" >> $GITHUB_ENV
# Override source if deploying (find .whl file in dist/)
if [[ "${{ contains(github.event.head_commit.message, '/deploy sit') ||
contains(github.event.head_commit.message, '/deploy uat') ||
contains(github.event.head_commit.message, '/deploy sandbox') }}" == "true" ]]; then
local_forge_py=$(find dist -type f -name "*.whl")
echo "SOURCE=${local_forge_py}" >> $GITHUB_ENV
echo "DIST_PATH=dist/" >> $GITHUB_ENV
fi
- name: Build and Push Docker Image
uses: docker/build-push-action@v6
if: |
contains(['refs/heads/develop', 'refs/heads/main'], github.ref) ||
startsWith(github.ref, 'refs/heads/release') ||
contains(github.event.head_commit.message, '/deploy sit') ||
contains(github.event.head_commit.message, '/deploy uat') ||
contains(github.event.head_commit.message, '/deploy sandbox')
uses: docker/build-push-action@v3
with:
context: .
file: ./docker/lambdaDockerfileArm
push: true
pull: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/arm64
platforms: linux/arm/v7
build-args: |
DIST_PATH: ${{ contains(github.event.head_commit.message, '/deploy') && 'dist/' || '' }}
SOURCE: ${{ env.local_forge_py != '' && env.local_forge_py || format('{0}=={1}', needs.build.outputs.pyproject_name, needs.build.outputs.version) }}
SOURCE=${{ env.SOURCE }}
DIST_PATH=${{ env.DIST_PATH || '' }}

0 comments on commit 88d0cf6

Please sign in to comment.