44 lines
1.4 KiB
YAML
44 lines
1.4 KiB
YAML
name: deploy
|
|
|
|
on:
|
|
repository_dispatch:
|
|
types: [trigger-build-success]
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
deploy:
|
|
# see example https://github.com/do-community/example-doctl-action
|
|
# see example https://github.com/do-community/example-doctl-action/blob/main/.github/workflows/workflow.yaml
|
|
name: Deploy defined version to stage.ocelot.social cluster at DigitalOcean
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
SECRET: ${{ secrets.SECRET }}
|
|
CONFIGURATION: "this"
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v3
|
|
- name: Decrypt .env
|
|
run: gpg --quiet --batch --yes --decrypt --passphrase="${SECRET}" --output .env .env.enc
|
|
- name: Load .env
|
|
uses: aarcangeli/load-dotenv@v1.0.0
|
|
with:
|
|
quiet: true
|
|
- name: Checkout Ocelot code
|
|
uses: actions/checkout@v3
|
|
with:
|
|
repository: 'Ocelot-Social-Community/Ocelot-Social'
|
|
ref: ${{ env.GITHUB_OCELOT_TAG }}
|
|
path: 'ocelot/'
|
|
fetch-depth: 0
|
|
- name: Checkout code
|
|
uses: actions/checkout@v3
|
|
with:
|
|
path: "ocelot/deployment/configurations/${{ env.CONFIGURATION }}"
|
|
- name: Decrypt all secrets
|
|
run: ocelot/deployment/scripts/secrets.decrypt.sh
|
|
- name: Upgrade Cluster
|
|
run: ocelot/deployment/scripts/cluster.upgrade.sh
|
|
- name: Reset and seed Neo4j database
|
|
run: ocelot/deployment/scripts/cluster.reseed.sh |