-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9c6524b
commit b792dd3
Showing
1 changed file
with
63 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||