Skip to content

Commit

Permalink
Update GitHub action workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
vrajmohan committed Jan 12, 2024
1 parent cd579ea commit dc18db8
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 9 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ jobs:
postgres:
image: postgres
env:
POSTGRES_USER: la-doc-uploader-test
POSTGRES_DB: la-doc-uploader-test
POSTGRES_USER: mdbenefits_test
POSTGRES_DB: mdbenefits_test
POSTGRES_PASSWORD: postgres
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
ports:
Expand Down Expand Up @@ -75,5 +75,5 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARTIFACT_ID }}
path: /home/runner/work/la-doc-uploader/results
retention-days: 14
path: /home/runner/work/mdbenefits/results
retention-days: 14
55 changes: 55 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Deploy to Aptible

on:
workflow_run:
workflows: ["Run tests"]
types: [completed]
branches: [main]
workflow_dispatch:
inputs: { }

env:
USERNAME: ${{ secrets.GPR_USER }}
TOKEN: ${{ secrets.GPR_KEY }}

jobs:
deploy:
name: Deploy to Aptible
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch }}
fetch-depth: 0
- name: Install SSH Key
uses: shimataro/[email protected]
with:
key: ${{ secrets.APTIBLE_SSH_PRIVATE_KEY }}
known_hosts: ${{ secrets.APTIBLE_KNOWN_HOSTS }}
- name: Push to Aptible remote branch
run: |
ssh-keyscan beta.aptible.com >> ~/.ssh/known_hosts
git remote add aptible ${{ vars.APTIBLE_REMOTE_URL }}
git push --force ${{ vars.APTIBLE_REMOTE_URL }} ${GITHUB_SHA}:${{ vars.APTIBLE_REMOTE_BRANCH }}
- name: Announce on Slack when deploy fails
if: failure()
uses: ravsamhq/notify-slack-action@v2
with:
status: ${{ job.status }}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
- name: Set Aptible environment variables and deploy
run: |
wget -O aptible-package https://omnibus-aptible-toolbelt.s3.amazonaws.com/aptible/omnibus-aptible-toolbelt/master/206/pkg/aptible-toolbelt_0.16.5%2B20200508143656~ubuntu.16.04-1_amd64.deb
sudo dpkg -i aptible-package
aptible login --email=${{ secrets.APTIBLE_USERNAME }} --password=${{ secrets.APTIBLE_PASSWORD}}
aptible deploy --app demo --git-commitish ${{ vars.APTIBLE_REMOTE_BRANCH }} SPRING_PROFILES_ACTIVE=demo \
'SPRING_DATASOURCE_URL=${{ secrets.SPRING_DATASOURCE_URL }}' \
'AWS_ACCESS_KEY=${{ secrets.AWS_ACCESS_KEY }}' \
'AWS_SECRET_KEY=${{ secrets.AWS_SECRET_KEY }}' \
'SMARTY_AUTH_ID=${{ secrets.SMARTY_AUTH_ID }}' \
'SMARTY_AUTH_TOKEN=${{ secrets.SMARTY_AUTH_TOKEN }}' \
'MAILGUN_KEY=${{ secrets.MAILGUN_KEY }}' \
'SPRING_DATASOURCE_USERNAME=${{ secrets.SPRING_DATASOURCE_USERNAME }}' \
'SPRING_DATASOURCE_PASSWORD=${{ secrets.SPRING_DATASOURCE_PASSWORD }}' \
'CLAMAV_URL=${{ vars.CLAMAV_URL }}'
10 changes: 5 additions & 5 deletions .github/workflows/run-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ jobs:
postgres:
image: postgres
env:
POSTGRES_USER: la-doc-uploader-test
POSTGRES_DB: la-doc-uploader-test
POSTGRES_USER: mdbenefits_test
POSTGRES_PASSWORD: postgres
POSTGRES_DB: mdbenefits_test
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
ports:
- 5432:5432
Expand Down Expand Up @@ -70,8 +70,8 @@ jobs:
postgres:
image: postgres
env:
POSTGRES_USER: la-doc-uploader-test
POSTGRES_DB: la-doc-uploader-test
POSTGRES_USER: mdbenefits_test
POSTGRES_DB: mdbenefits_test
POSTGRES_PASSWORD: postgres
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
ports:
Expand Down Expand Up @@ -103,4 +103,4 @@ jobs:
- name: Cleanup Gradle Cache
run: |
rm -f ~/.gradle/caches/modules-2/modules-2.lock
rm -f ~/.gradle/caches/modules-2/gc.properties
rm -f ~/.gradle/caches/modules-2/gc.properties
File renamed without changes.

0 comments on commit dc18db8

Please sign in to comment.