diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index db5bbb25..9c7ee393 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -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: @@ -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 \ No newline at end of file + path: /home/runner/work/mdbenefits/results + retention-days: 14 diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml new file mode 100644 index 00000000..59bc97c4 --- /dev/null +++ b/.github/workflows/deploy.yaml @@ -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/ssh-key-action@v2.6.1 + 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 }}' diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml index c1e4ba0b..4818d17d 100644 --- a/.github/workflows/run-tests.yaml +++ b/.github/workflows/run-tests.yaml @@ -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 @@ -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: @@ -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 \ No newline at end of file + rm -f ~/.gradle/caches/modules-2/gc.properties diff --git a/src/test/resources/application-test.yaml b/src/main/resources/application-test.yaml similarity index 100% rename from src/test/resources/application-test.yaml rename to src/main/resources/application-test.yaml