-
Notifications
You must be signed in to change notification settings - Fork 1
93 lines (90 loc) · 2.92 KB
/
deploy-projects.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: Deploy Projects
on:
push:
branches:
- master
paths:
- 'projects/**'
- '.github/workflows/deploy.sh'
- '.github/workflows/deploy-projects.yml'
concurrency:
group: deploy-projects
cancel-in-progress: true
jobs:
projects-images:
name: Projects Images
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to Docker
uses: docker/login-action@v2
with:
registry: ${{ secrets.DOCKER_REGISTRY }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push base
uses: docker/bake-action@v3
with:
push: true
workdir: projects/
files: docker-compose.base.yaml
set: |
*.cache-to=type=gha,mode=max
*.cache-from=type=gha
- name: Build and push techs
uses: docker/bake-action@v3
with:
push: true
workdir: projects/
files: docker-compose.techs.yaml
set: |
*.cache-to=type=gha,mode=max
*.cache-from=type=gha
projects-proxy:
name: Projects Proxy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build the Projects Proxy Docker Image
uses: whoan/docker-build-with-cache-action@v6
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
registry: ${{ secrets.DOCKER_REGISTRY }}
image_name: fulib/fulib.org-projects-proxy
context: projects/
dockerfile: proxy/Dockerfile
projects-runtime:
name: Projects Runtime
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build the Projects Runtime Docker Image
uses: whoan/docker-build-with-cache-action@v6
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
registry: ${{ secrets.DOCKER_REGISTRY }}
image_name: fulib/fulib.org-projects-runtime
context: projects/
dockerfile: runtime/Dockerfile
projects-deploy:
name: Projects Deployment
runs-on: ubuntu-latest
needs: [ projects-images, projects-proxy, projects-runtime ]
steps:
- name: Deploy the Projects Runtime to Rancher
uses: sekassel-research/actions-rancher-update@v3.0.0
with:
rancher_url: ${{ secrets.RANCHER_URL }}
rancher_token: ${{ secrets.RANCHER_TOKEN }}
cluster_id: ${{ secrets.RANCHER_CLUSTER }}
project_id: ${{ secrets.RANCHER_PROJECT }}
namespace: ${{ secrets.NAMESPACE }}
deployment: fulib-projects-runtime
docker_image: ${{ secrets.DOCKER_REGISTRY }}/fulib/fulib.org-projects-runtime