Merge pull request #413 from fujaba/chore/update-dependencies #46
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 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 | |
concurrency: | |
group: deploy-services-${{ matrix.service }} | |
cancel-in-progress: true | |
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 }} |