-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
94e34b6
commit ca767f9
Showing
7 changed files
with
177 additions
and
21 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
name: Deploy | ||
|
||
on: | ||
workflow_dispatch: | ||
release: | ||
types: [published] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
permissions: | ||
packages: write | ||
|
||
jobs: | ||
build_and_push: | ||
name: Build and Push | ||
runs-on: ubuntu-latest | ||
strategy: | ||
# Prevent a failure in one image from stopping the other builds | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- image: uftos-api | ||
context: . | ||
file: server/Dockerfile | ||
platforms: linux/amd64,linux/arm64 | ||
device: cpu | ||
- image: immich-web | ||
context: . | ||
file: web/Dockerfile | ||
platforms: linux/amd64,linux/arm64 | ||
device: cpu | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3.2.0 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3.6.1 | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Generate docker image tags | ||
id: metadata | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: | | ||
name=ghcr.io/${{ github.repository_owner }}/${{matrix.image}} | ||
name=pse-timetable/${{matrix.image}},enable=${{ github.event_name == 'release' }} | ||
tags: | | ||
# Tag with git tag on release | ||
type=ref,event=tag | ||
type=raw,value=release,enable=${{ github.event_name == 'release' }} | ||
- name: Determine build cache output | ||
id: cache-target | ||
run: | | ||
echo "cache-to=type=registry,mode=max,ref=ghcr.io/${{ github.repository_owner }}/immich-build-cache:${{ matrix.image }}" >> $GITHUB_OUTPUT | ||
- name: Build and push image | ||
uses: docker/build-push-action@v6.7.0 | ||
with: | ||
context: ${{ matrix.context }} | ||
file: ${{ matrix.file }} | ||
platforms: ${{ matrix.platforms }} | ||
# Skip pushing when PR from a fork | ||
push: true | ||
cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/uftos-build-cache:${{matrix.image}} | ||
cache-to: ${{ steps.cache-target.outputs.cache-to }} | ||
tags: ${{ steps.metadata.outputs.tags }} | ||
labels: ${{ steps.metadata.outputs.labels }} | ||
build-args: | | ||
DEVICE=${{ matrix.device }} | ||
BUILD_ID=${{ github.run_id }} | ||
BUILD_IMAGE=${{ github.event_name == 'release' && github.ref_name || steps.metadata.outputs.tags }} | ||
BUILD_SOURCE_REF=${{ github.ref_name }} | ||
BUILD_SOURCE_COMMIT=${{ github.sha }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Prepare new release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: "The version of the release" | ||
required: true | ||
type: string | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }}-root | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
prepare_release: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Create draft release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
draft: true | ||
tag_name: ${{ inputs.version }} | ||
generate_release_notes: true | ||
files: | | ||
docker-compose.yml |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
services: | ||
db: | ||
image: postgres:16.3-alpine3.18 | ||
container_name: uftos-db | ||
restart: unless-stopped | ||
ports: | ||
- 5432:5432 | ||
volumes: | ||
- pgdata:/var/lib/postgresql/data | ||
environment: | ||
POSTGRES_USER: uftos | ||
POSTGRES_PASSWORD: superSecurePassword | ||
POSTGRES_DB: uftos | ||
api: | ||
image: uftos-api-dev:latest | ||
container_name: uftos-api | ||
build: | ||
context: ./ | ||
dockerfile: server/Dockerfile | ||
restart: unless-stopped | ||
ports: | ||
- 8080:8080 | ||
# debug port | ||
- 5005:5005 | ||
volumes: | ||
- ./server:/app | ||
depends_on: | ||
- db | ||
environment: | ||
DB_HOST: db | ||
DB_PORT: 5432 | ||
DB_USER: uftos | ||
DB_PASSWORD: superSecurePassword | ||
DB_NAME: uftos | ||
MAIL_HOST: mail.example.org | ||
MAIL_USER: myUser | ||
MAIL_PASSWORD: highlySecurePassword | ||
MAIL_FROM: uftos@example.com | ||
web: | ||
image: uftos-web-dev:latest | ||
container_name: uftos-web | ||
build: | ||
context: ./web | ||
ports: | ||
- 5173:5173 | ||
volumes: | ||
- ./web:/app | ||
- /app/node_modules | ||
restart: unless-stopped | ||
|
||
volumes: | ||
pgdata: |
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
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
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