Merge pull request #375 from fujaba/fix/assignments #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |