Skip to content

Commit

Permalink
Test the whole workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
sshrihar committed Sep 18, 2024
1 parent bfd5c9f commit 9c94014
Showing 1 changed file with 29 additions and 46 deletions.
75 changes: 29 additions & 46 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,58 +23,41 @@ jobs:
- name: Checkout Code Repository
uses: actions/checkout@v3
with:
ref: "Swader-patch-1"
fetch-depth: 0

- uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: List branches matching pattern
- name: Install pipenv
run: pip install pipenv

- name: Build Site
run: |
cat .git/config
git branch -r
# branches=$(git branch -r --list)
# echo "Matching branches: $branches"
python build_branches.py '*kmurphy*'
# - name: Create folders and checkout branches
# run: |
# for branch in $branches; do
# branch_name=$(echo "$branch" | sed 's|origin/||')
# mkdir -p branch/$branch_name
# git checkout -b "$branch_name" --track "origin/$branch_name"
# done
# ls -lrt branch
- name: Set Environment Variable
id: set-env-var
run: |
if [ "${{ inputs.environment }}" == "dev" ]; then
echo "ACCOUNT_NUMBER=058264511034" >> $GITHUB_OUTPUT
echo "APP_NAME=${{ inputs.core_app }}-dev" >> $GITHUB_OUTPUT
echo "CLUSTER_NAME=frontend-dev-ecs-cluster" >> $GITHUB_OUTPUT
elif [ "${{ inputs.environment }}" == "staging" ]; then
echo "ACCOUNT_NUMBER=070528468658" >> $GITHUB_OUTPUT
echo "APP_NAME=${{ inputs.core_app }}-staging" >> $GITHUB_OUTPUT
echo "CLUSTER_NAME=frontend-staging-ecs-cluster" >> $GITHUB_OUTPUT
fi
# - name: Install pipenv
# run: pip install pipenv
#
# - name: Build Site
# run: |
# python build_branches.py '*kmurphy*'
#
# - name: Set Environment Variable
# id: set-env-var
# run: |
# if [ "${{ inputs.environment }}" == "dev" ]; then
# echo "ACCOUNT_NUMBER=058264511034" >> $GITHUB_OUTPUT
# echo "APP_NAME=${{ inputs.core_app }}-dev" >> $GITHUB_OUTPUT
# echo "CLUSTER_NAME=frontend-dev-ecs-cluster" >> $GITHUB_OUTPUT
# elif [ "${{ inputs.environment }}" == "staging" ]; then
# echo "ACCOUNT_NUMBER=070528468658" >> $GITHUB_OUTPUT
# echo "APP_NAME=${{ inputs.core_app }}-staging" >> $GITHUB_OUTPUT
# echo "CLUSTER_NAME=frontend-staging-ecs-cluster" >> $GITHUB_OUTPUT
# fi
#
# deploy:
# uses: 0xPolygon/pipelines/.github/workflows/ecs_deploy_docker_taskdef.yaml@main
# needs: set-env-variable
# with:
# app_name: ${{ needs.set-env-variable.outputs.APP_NAME }}
# taskdef_file_vars: .github/assets/${{ inputs.environment }}-taskdef.yaml
# aws_region: eu-west-1
# environment: ${{ inputs.environment }}
# cluster_name: ${{ needs.set-env-variable.outputs.CLUSTER_NAME }}
# account_number: "${{ needs.set-env-variable.outputs.ACCOUNT_NUMBER }}"
# docker_file: Dockerfile.review
# secrets: inherit
deploy:
uses: 0xPolygon/pipelines/.github/workflows/ecs_deploy_docker_taskdef.yaml@main
needs: set-env-variable
with:
app_name: ${{ needs.set-env-variable.outputs.APP_NAME }}
taskdef_file_vars: .github/assets/${{ inputs.environment }}-taskdef.yaml
aws_region: eu-west-1
environment: ${{ inputs.environment }}
cluster_name: ${{ needs.set-env-variable.outputs.CLUSTER_NAME }}
account_number: "${{ needs.set-env-variable.outputs.ACCOUNT_NUMBER }}"
docker_file: Dockerfile.review
secrets: inherit

0 comments on commit 9c94014

Please sign in to comment.