-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (38 loc) · 1.2 KB
/
deploy.yml
File metadata and controls
42 lines (38 loc) · 1.2 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
name: Deploy
on: [ push ]
jobs:
deploy:
runs-on: ubuntu-22.04
if: github.ref == 'refs/heads/master'
concurrency: deploy-${{ github.ref }}
steps:
- uses: actions/checkout@v3
- uses: docker/setup-buildx-action@v1
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Docker images
uses: docker/bake-action@v4
with:
pull: true
load: true
files: |
compose.prod.yaml
set: |
*.cache-from=type=gha,scope=${{github.ref}}
*.cache-from=type=gha,scope=refs/heads/main
*.cache-to=type=gha,scope=${{github.ref}},mode=max
- name: Push Docker images
run: docker push ghcr.io/florentdestremau/bera-watcher:latest
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_PRIVATE_KEY }}
name: id_ed25519
known_hosts: ${{ secrets.ssh_KNOWN_HOSTS }}
if_key_exists: fail
- name: Deploy on server
run: ./deploy.sh