Skip to content

Merge pull request #168 from Morphclue/chore/update #109

Merge pull request #168 from Morphclue/chore/update

Merge pull request #168 from Morphclue/chore/update #109

Workflow file for this run

name: Deploy
on:
push:
branches:
- master
jobs:
deploy:
name: Deploy ${{ matrix.app }}
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
app:
- frontend
- backend
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# https://docs.docker.com/build/ci/github-actions/push-multi-registries/
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: ${{ secrets.DOCKER_REGISTRY }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: apps/${{ matrix.app }}/Dockerfile
push: true
# ${{ github.repository_owner }} does not work. See https://github.com/orgs/community/discussions/27086
# If we ever move this to a different org, we need to update this line.
tags: |
${{ secrets.DOCKER_REGISTRY }}/apollusia/${{ matrix.app }}
ghcr.io/morphclue/apollusia-${{ matrix.app }}
cache-to: type=gha,mode=max
cache-from: type=gha
# https://github.com/sekassel-research/actions-rancher-update?tab=readme-ov-file#update-service
- 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: apollusia
deployment: ${{ matrix.app }}
docker_image: ${{ secrets.DOCKER_REGISTRY }}/apollusia/${{ matrix.app }}:latest