-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (41 loc) · 1.24 KB
/
ci.yaml
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
45
46
47
48
name: 'CI'
on:
workflow_dispatch:
inputs:
tag:
description: 'Image tag'
default: 'latest'
required: false
type: string
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 }}:${{ inputs.tag }}
cache-from: type=gha,ref=${{ env.IMAGE_NAME }}:buildcache
cache-to: type=gha,ref=${{ env.IMAGE_NAME }}:buildcache,mode=max