Skip to content

Commit

Permalink
Merge branch 'fixing-lower-env' into gha-ip-set
Browse files Browse the repository at this point in the history
  • Loading branch information
berryd committed Jan 18, 2024
2 parents 0474261 + 7fe4654 commit 93efc47
Showing 1 changed file with 7 additions and 52 deletions.
59 changes: 7 additions & 52 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,6 @@ jobs:
run: |
which jq
jq --version
# - name: Get IP
# id: get-ip
# run: |
# #!/bin/bash
# # Get the IP address of the runner
# IP_ADDRESS=$(curl https://api.ipify.org)
# echo "Runner IP address: $IP_ADDRESS"
# # Store the IP address as an output variable
# echo "RUNNER_IP=$IP_ADDRESS/32" >> $GITHUB_OUTPUT
# - name: Show IP Address
# run: |
# #!/bin/bash
# echo "IP address from previous step: ${{ steps.get-ip.outputs.RUNNER_IP }}"
- name: Validate branch name
run: ./.github/branchNameValidation.sh $STAGE_PREFIX$branch_name
- name: set branch specific variable names
Expand Down Expand Up @@ -100,11 +87,11 @@ jobs:
- name: set path
run: |
echo "PATH=$(pwd)/node_modules/.bin/:$PATH" >> $GITHUB_ENV
#- name: deploy
# run: |
# # When deploying multiple copies of this quickstart to the same AWS Account (not ideal), a prefix helps prevent stepping on each other.
# # This can optionally be set as an GitHub Actions Secret
# ./deploy.sh $STAGE_PREFIX$branch_name
- name: deploy
run: |
# When deploying multiple copies of this quickstart to the same AWS Account (not ideal), a prefix helps prevent stepping on each other.
# This can optionally be set as an GitHub Actions Secret
./deploy.sh $STAGE_PREFIX$branch_name
- name: Endpoint
id: endpoint
run: |
Expand Down Expand Up @@ -368,44 +355,12 @@ jobs:
env:
SLS_DEPRECATION_DISABLE: "*" # Turn off deprecation warnings in the pipeline
steps:
- name: set branch_name # Some integrations (Dependabot & Snyk) build very long branch names. This is a switch to make long branch names shorter.
run: |
echo "GITHUB_REF=${GITHUB_REF}"
if [[ "$GITHUB_REF" =~ ^refs/heads/dependabot/.* ]]; then
echo "branch_name=`echo ${GITHUB_REF##*/*-} | md5sum | head -c 10 | sed 's/^/x/'`" >> $GITHUB_ENV
elif [[ "$GITHUB_REF" =~ ^refs/.*/snyk-* ]]; then
echo "branch_name=`echo ${GITHUB_REF##*/*-} | head -c 10 | sed 's/^/s/'`" >> $GITHUB_ENV
else
echo "branch_name=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
fi
- uses: actions/checkout@v3
- name: Validate branch name
run: ./.github/branchNameValidation.sh $STAGE_PREFIX$branch_name
- name: set branch specific variable names
run: ./.github/build_vars.sh set_names
- name: set variable values
run: ./.github/build_vars.sh set_values
env:
AWS_DEFAULT_REGION: ${{ secrets[env.BRANCH_SPECIFIC_VARNAME_AWS_DEFAULT_REGION] || secrets.AWS_DEFAULT_REGION }}
AWS_OIDC_ROLE_TO_ASSUME: ${{ secrets[env.BRANCH_SPECIFIC_VARNAME_AWS_OIDC_ROLE_TO_ASSUME] || secrets.AWS_OIDC_ROLE_TO_ASSUME }}
STAGE_PREFIX: ${{ secrets.STAGE_PREFIX }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
CODE_CLIMATE_ID: ${{ secrets.CODE_CLIMATE_ID }}
- name: Configure AWS credentials for GitHub Actions
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.AWS_OIDC_ROLE_TO_ASSUME }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
- uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
- uses: actions/cache@v3
with:
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock', 'plugins/**') }}
- name: set path
run: |
echo "PATH=$(pwd)/node_modules/.bin/:$PATH" >> $GITHUB_ENV
role-to-assume: ${{ secrets[env.BRANCH_SPECIFIC_VARNAME_AWS_OIDC_ROLE_TO_ASSUME] || secrets.AWS_OIDC_ROLE_TO_ASSUME }}
aws-region: ${{ secrets[env.BRANCH_SPECIFIC_VARNAME_AWS_DEFAULT_REGION] || secrets.AWS_DEFAULT_REGION }}
- name: clean-up-iplist
id: reset-ip-set
run: ./.github/waf-controller.sh ${{ needs.e2e-tests-init.outputs.ipset_name }} ${{ needs.e2e-tests-init.outputs.ipset_id }} '[]'
Expand Down

0 comments on commit 93efc47

Please sign in to comment.