-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (52 loc) · 2.23 KB
/
deploy.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
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 }}'