-
Notifications
You must be signed in to change notification settings - Fork 10
40 lines (36 loc) · 1.28 KB
/
deploy.yml
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
name: Deploy
on:
- workflow_dispatch
jobs:
deploy:
runs-on: ubuntu-latest
steps:
# Checkout repo from GitHub
- uses: actions/checkout@v4
# Set envars for deployment.
- name: Set env vars
run: |
if [ "${{ github.ref }}" = "refs/heads/develop" ]; then
echo "COMPOSE_SUFFIX=staging" >> $GITHUB_ENV
echo "PROJECT=clerk_test" >> $GITHUB_ENV
elif [ "${{ github.ref }}" = "refs/heads/master" ]; then
echo "COMPOSE_SUFFIX=prod" >> $GITHUB_ENV
echo "PROJECT=clerk" >> $GITHUB_ENV
else
echo "Please specify either the develop branch for staging or master branch for prod"
exit 1
fi
# Setup transcrypt so that we can read secrets
- name: Checkout transcrypt
uses: actions/checkout@v4
with:
repository: elasticdog/transcrypt
path: transcrypt
- name: Initialise transcrypt
run: ./transcrypt/transcrypt -c aes-256-cbc -p '${{ secrets.TRANSCRYPT_PASSWORD }}' --yes
# Update Docker Swarm on clerk server to deploy new container.
- name: Run deploy script
run: ./infra/deploy.sh
shell: bash
env:
CLERK_PRIVATE_SSH_KEY: ${{ secrets.CLERK_PRIVATE_SSH_KEY }}