-
Notifications
You must be signed in to change notification settings - Fork 3
67 lines (63 loc) · 2.3 KB
/
Copy pathdeploy.yaml
File metadata and controls
67 lines (63 loc) · 2.3 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
name: Deploy
on:
workflow_dispatch:
inputs:
environment:
required: true
type: string
tag:
required: true
type: string
workflow_call:
inputs:
environment:
required: true
type: string
tag:
required: true
type: string
jobs:
deploy:
name: ${{ inputs.environment }}
runs-on: ubuntu-latest
environment:
name: ${{ inputs.environment }}
url: ${{ steps.deployment.outputs.url }}
concurrency: ${{ inputs.environment }}
# Needed to connect to ghcr.io registry
permissions:
contents: read
packages: read
steps:
- uses: actions/checkout@v4
- run: |
curl -sSL https://github.com/bitwarden/sdk-sm/releases/download/bws-v1.0.0/bws-x86_64-unknown-linux-gnu-1.0.0.zip -o bws.zip
unzip bws.zip
sudo mv bws /usr/local/bin/
rm bws.zip
- run: |
bws secret list ${{ secrets.BWS_PROJECT_ID }} --output=env > .kamal/secrets.${{ inputs.environment }}
env:
BWS_ACCESS_TOKEN: ${{ secrets.BWS_ACCESS_TOKEN }}
- uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_PRIVATE_KEY }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
bundler-cache: true
- run: gem install kamal -v 2.4.0
- run: make deploy
env:
KAMAL: kamal # Use the kamal binary installed in the previous step
DESTINATION: ${{ inputs.environment }}
VERSION: ${{ inputs.tag }}
SSH_HOST: ${{ secrets.SSH_HOST }}
SSH_PORT: ${{ secrets.SSH_PORT }}
SSH_USER: ${{ secrets.SSH_USER }}
DOCKER_USERNAME: ${{ github.repository_owner }}
DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
- id: deployment
run: |
echo "url=${{ vars.DEPLOYMENT_URL }}" >> $GITHUB_OUTPUT