Skip to content

feat(deploy): add caddy server image build #4

feat(deploy): add caddy server image build

feat(deploy): add caddy server image build #4

Workflow file for this run

name: Karr Pipeline (lint, build)
on:
push:
branches:
- main
pull_request:
permissions:
contents: read
jobs:
lint:
runs-on: ubuntu-latest
env:
DENO_DIR: .deno
steps:
- name: Git Checkout
uses: actions/checkout@v2
- name: Use Deno Version
uses: denolib/setup-deno@v2
with:
deno-version: 2.1.2
- name: Format all files
run: deno fmt --check
- name: Lint project
run: deno lint
build-api:
needs: lint
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
permissions:
contents: read
packages: write
steps:
- name: Git Checkout
uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: https://ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push API Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./apps/api/Dockerfile
push: true
tags: |
ghcr.io/finxol/karr-api:latest
ghcr.io/finxol/karr-api:${{ github.sha }}
build-server:
needs: lint
runs-on: ubuntu-latest
if: >
github.event_name == 'push' &&
github.ref == 'refs/heads/main' &&
(contains(github.event.commits[*].modified, 'apps/server/') ||
contains(github.event.commits[*].added, 'apps/server/') ||
contains(github.event.commits[*].removed, 'apps/server/'))
permissions:
contents: read
packages: write
steps:
- name: Git Checkout
uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: https://ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Server Docker image
uses: docker/build-push-action@v5
with:
context: ./apps/server
file: Dockerfile
push: true
tags: |
ghcr.io/finxol/karr-server:latest
ghcr.io/finxol/karr-server:${{ github.sha }}