Skip to content

CI

CI #114

Workflow file for this run

name: 'CI'
on:
push:
branches:
- main
workflow_dispatch:
env:
IMAGE_NAME: registry.digitalocean.com/cutu2024/cutu2024-backend
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
server:
- 'apps/server/**'
- name: Login to registry
uses: docker/login-action@v2
if: steps.changes.outputs.server == 'true'
with:
registry: registry.digitalocean.com
username: ${{ secrets.do_username }}
password: ${{ secrets.do_token }}
- name: Setup buildx
uses: docker/setup-buildx-action@v2
if: steps.changes.outputs.server == 'true'
- name: Build and push
uses: docker/build-push-action@v3
if: steps.changes.outputs.server == 'true'
with:
push: true
context: "{{defaultContext}}:apps/server"
tags: ${{ env.IMAGE_NAME }}:latest
cache-from: type=gha,ref=${{ env.IMAGE_NAME }}:buildcache
cache-to: type=gha,ref=${{ env.IMAGE_NAME }}:buildcache,mode=max