Skip to content

Commit

Permalink
testing new yml
Browse files Browse the repository at this point in the history
  • Loading branch information
dmekala-va committed Jul 9, 2024
1 parent 9c6524b commit b792dd3
Showing 1 changed file with 63 additions and 22 deletions.
85 changes: 63 additions & 22 deletions .github/workflows/github-release.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,65 @@
# name: Weekly Release Build

# on:
# push:
# branches: [API-37625-gh-release-build]
# schedule:
# - cron: '0 22 * * 1'

# jobs:
# release_build:
# runs-on: ubuntu-latest
# env:
# REPO: "lighthouse-saml-proxy"
# IMAGE: "saml-proxy"
# XCHECKS: "saml-proxy-release"
# strategy:
# matrix:
# environment: ['dev', 'staging']
name: Weekly Release Build

on:
push:
branches: [API-37625-gh-release-build]
schedule:
- cron: '0 22 * * 1'

jobs:
release_build:
runs-on: ubuntu-latest
env:
REPO: "lighthouse-saml-proxy"
IMAGE: "saml-proxy"
XCHECKS: "saml-proxy-release"
strategy:
matrix:
environment: ['dev', 'staging']

# steps:
# - name: Checkout Repository
# uses: actions/checkout@v2
steps:
- name: Checkout Repository
uses: actions/checkout@v2

# -name: Setup No
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '16'

- name: Print Environment Variables
run: |
echo "REPO=${REPO}"
echo "IMAGE=${IMAGE}"
echo "XCHECKS=${XCHECKS}"
echo "GITHUB_SHA=${GITHUB_SHA}"
- name: Create Release
run: |
old_tag=$(git tag --sort=-creatordate | grep fargate-saml-proxy | head -1)
echo "Found ${old_tag} - incrementing..."
new_tag=$(./increment.sh ${old_tag})
echo "Creating release ${new_tag}"
gh release create ${new_tag} -t ${new_tag}
- name: Tag ECR Image
run: |
make tag IMAGE=${IMAGE} TAG=${GITHUB_SHA:0:7} NEW_TAG=${new_tag}
- name: Tag ECR Image
run: |
make tag IMAGE=${IMAGE}-tests TAG=${GITHUB_SHA:0:7} NEW_TAG=${new_tag}
- name: Deploy to AWS codebuild
if: env.DEPLOY == 'true'
run: |
aws codebuild start-build --project-name saml-proxy-deploy --environment-variables-override name=RELEASE,value=${new_tag}
- name: Post to Slack (Success or Failure)
run: |
if [ "${{ job.status }}" == "success" ]; then
./slackpost.sh -t success "SAML Proxy release ${new_tag} was successful."
else
./slackpost.sh -t failure "there was an error with the release process for SAML Proxy!"
fi

0 comments on commit b792dd3

Please sign in to comment.