-
Notifications
You must be signed in to change notification settings - Fork 3
51 lines (42 loc) · 1.3 KB
/
Copy pathcd.yml
File metadata and controls
51 lines (42 loc) · 1.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
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
timeout-minutes: 15
needs: Build
concurrency:
group: cd-production
env:
DESTINATION: production
permissions:
packages: write
steps:
- name: Checkout the code
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Install Ruby
uses: ruby/setup-ruby@8e41b362d2589a22a44c1cfa214b3c83052c195b # v1.318.0
with:
bundler-cache: true
- name: Start the SSH agent
uses: webfactory/ssh-agent@e83874834305fe9a4a2997156cb26c5de65a8555 # v0.10.0
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0
- name: Deploy the application
shell: bash
env:
${{ insert }}: ${{ secrets }}
DOCKER_BUILDKIT: 1
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