release-2023-11-27 #63
Workflow file for this run
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
name: Deploy to Aptible Prod | |
on: | |
workflow_dispatch: | |
inputs: { } | |
release: | |
types: [published] | |
env: | |
USERNAME: ${{ secrets.GPR_USER }} | |
TOKEN: ${{ secrets.GPR_KEY }} | |
APTIBLE_BRANCH: ${{ vars.APTIBLE_REMOTE_BRANCH }} | |
jobs: | |
deploy_en: | |
name: Deploy to Aptible (en) | |
runs-on: ubuntu-latest | |
steps: | |
- name: Fetch Latest Release | |
id: fetch-latest-release | |
uses: thebritican/fetch-latest-release@v2.0.0 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ steps.fetch-latest-release.outputs.tag_name }} | |
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: git push --force ${{ vars.APTIBLE_REMOTE_URL }} "${GITHUB_SHA}:prod-deploy" | |
- 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 app-prod --git-commitish ${GITHUB_SHA} \ | |
'SPRING_PROFILES_ACTIVE=prod' \ | |
'DEFAULT_LOCALE=en' \ | |
'SPRING_DATASOURCE_URL=${{ secrets.SPRING_DATASOURCE_URL }}' \ | |
'AWS_ACCESS_KEY=${{ secrets.AWS_ACCESS_KEY }}' \ | |
'AWS_SECRET_KEY=${{ secrets.AWS_SECRET_KEY }}' \ | |
'AWS_BUCKET=${{ secrets.AWS_BUCKET_PROD }}' \ | |
'AWS_CMK=${{ secrets.AWS_CMK_PROD }}' \ | |
'SENTRY_DSN=${{ secrets.SENTRY_DSN }}' \ | |
'SENTRY_ENVIRONMENT=prod' \ | |
'FORCE_SSL=true' \ | |
'ENCRYPTION_KEY=${{ secrets.ENCRYPTION_KEY }}' \ | |
'SPRING_DATASOURCE_USERNAME=${{ secrets.SPRING_DATASOURCE_USERNAME }}' \ | |
'SPRING_DATASOURCE_PASSWORD=${{ secrets.SPRING_DATASOURCE_PASSWORD }}' \ | |
'DEFAULT_USER=${{ secrets.DEFAULT_USER }}' \ | |
'DEFAULT_PASSWORD=${{ secrets.DEFAULT_PASSWORD }}' \ | |
'demo=false' \ | |
'RELEASE_HEALTHCHECK_TIMEOUT=900' | |
deploy_es: | |
needs: | |
- deploy_en | |
name: Deploy to Aptible (es) | |
runs-on: ubuntu-latest | |
steps: | |
- name: Fetch Latest Release | |
id: fetch-latest-release | |
uses: thebritican/fetch-latest-release@v2.0.0 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ steps.fetch-latest-release.outputs.tag_name }} | |
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: git push --force ${{ vars.APTIBLE_REMOTE_URL_ES }} "${GITHUB_SHA}:prod-es-deploy" | |
- 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 app-prod-es --git-commitish ${GITHUB_SHA} \ | |
'SPRING_PROFILES_ACTIVE=prod' \ | |
'DEFAULT_LOCALE=es' \ | |
'SPRING_DATASOURCE_URL=${{ secrets.SPRING_DATASOURCE_URL }}' \ | |
'AWS_ACCESS_KEY=${{ secrets.AWS_ACCESS_KEY }}' \ | |
'AWS_SECRET_KEY=${{ secrets.AWS_SECRET_KEY }}' \ | |
'AWS_BUCKET=${{ secrets.AWS_BUCKET_PROD }}' \ | |
'AWS_CMK=${{ secrets.AWS_CMK_PROD }}' \ | |
'SENTRY_DSN=${{ secrets.SENTRY_DSN }}' \ | |
'SENTRY_ENVIRONMENT=prod-es' \ | |
'FORCE_SSL=true' \ | |
'ENCRYPTION_KEY=${{ secrets.ENCRYPTION_KEY }}' \ | |
'SPRING_DATASOURCE_USERNAME=${{ secrets.SPRING_DATASOURCE_USERNAME }}' \ | |
'SPRING_DATASOURCE_PASSWORD=${{ secrets.SPRING_DATASOURCE_PASSWORD }}' \ | |
'DEFAULT_USER=${{ secrets.DEFAULT_USER }}' \ | |
'DEFAULT_PASSWORD=${{ secrets.DEFAULT_PASSWORD }}' \ | |
'demo=false' \ | |
'RELEASE_HEALTHCHECK_TIMEOUT=900' |