-
Notifications
You must be signed in to change notification settings - Fork 2
44 lines (42 loc) · 1.48 KB
/
deploy-backend.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
name: Deploy Backend
on:
push:
branches:
- master
tags:
- v*
# TODO the backend needs to be deployed every time because it contains the version number
# paths:
# - 'backend/**'
jobs:
backend:
name: Backend
runs-on: ubuntu-latest
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: Build the Backend 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-backend
image_tag: ${{ steps.deployment.outputs.tag }}
context: backend/
build_extra_args: --build-arg VERSION=${{ steps.deployment.outputs.version }}
- name: Deploy the Backend 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-backend
docker_image: ${{ secrets.DOCKER_REGISTRY }}/fulib/fulib.org-backend:${{ steps.deployment.outputs.tag }}