-
Notifications
You must be signed in to change notification settings - Fork 2
59 lines (57 loc) · 1.9 KB
/
deploy-services.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
name: Deploy Services
on:
push:
branches:
- master
tags:
- v*
paths:
- 'services/**'
- '.github/workflows/deploy.sh'
- '.github/workflows/deploy-services.yml'
jobs:
services:
name: Deploy ${{ matrix.service}} Service
runs-on: ubuntu-latest
strategy:
matrix:
service:
- projects
- assignments
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0 # for git describe
- name: Set Deployment Options
id: deployment
run: ./.github/workflows/deploy.sh
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: ${{ secrets.DOCKER_REGISTRY }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: services/
push: true
tags: ${{ secrets.DOCKER_REGISTRY }}/fulib/fulib.org-${{ matrix.service }}-service:${{ steps.deployment.outputs.tag }}
build-args: |
VERSION=${{ steps.deployment.outputs.version }}
SERVICE=${{ matrix.service }}
cache-to: type=gha,mode=max
cache-from: type=gha
- name: Deploy to Rancher
uses: sekassel-research/[email protected]
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-${{ matrix.service }}-service
docker_image: ${{ secrets.DOCKER_REGISTRY }}/fulib/fulib.org-${{ matrix.service }}-service:${{ steps.deployment.outputs.tag }}