-
Notifications
You must be signed in to change notification settings - Fork 2
52 lines (42 loc) · 1.23 KB
/
cd.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
41
42
43
44
45
46
47
48
49
50
51
52
name: CD
on: # yamllint disable-line rule:truthy
push:
branches:
- main
workflow_call:
jobs:
Build:
uses: ./.github/workflows/ci.yml
Deploy:
runs-on: ubuntu-latest
needs: Build
concurrency:
group: cd-production
env:
DESTINATION: production
steps:
- name: Checkout the code
uses: actions/checkout@v4
- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Start the SSH agent
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Set up Docker Buildx for cache
uses: docker/setup-buildx-action@v3
- name: Expose the GitHub Runtime for cache
uses: crazy-max/ghaction-github-runtime@v3
- name: Deploy the application
shell: bash
env:
${{ insert }}: ${{ secrets }}
DOCKER_BUILDKIT: 1
KAMAL_REGISTRY_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
run: bin/kamal deploy --destination=$DESTINATION
- name: Release the Kamal lock, if needed
shell: bash
if: ${{ cancelled() || failure() }}
run: bin/kamal lock release --destination=$DESTINATION