forked from rubyevents/rubyevents
-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (42 loc) · 1.35 KB
/
Copy pathdeploy-staging.yml
File metadata and controls
50 lines (42 loc) · 1.35 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
name: Deploy to Staging
on: workflow_dispatch
jobs:
deploy-staging:
name: Deploy to Staging
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
timeout-minutes: 20
env:
DOCKER_BUILDKIT: 1
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Setup SSH
uses: webfactory/ssh-agent@v0.9.0
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Deploy to Staging
env:
VERSION: ${{ github.sha }}
KAMAL_REGISTRY_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
KAMAL_RAILS_MASTER_KEY: ${{ secrets.KAMAL_RAILS_MASTER_KEY }}
GEOLOCATE_API_KEY: ${{ secrets.GEOLOCATE_API_KEY }}
MAPBOX_ACCESS_TOKEN: ${{ secrets.MAPBOX_ACCESS_TOKEN }}
run: bundle exec kamal deploy -d staging
- name: Cleanup on cancellation
if: always() && steps.deploy.conclusion == 'cancelled'
run: bundle exec kamal lock release