add gitea autobuild
This commit is contained in:
45
.gitea/workflows/build-and-deploy.yml
Normal file
45
.gitea/workflows/build-and-deploy.yml
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
name: Build and Deploy Website
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
paths:
|
||||||
|
- 'Sources/**'
|
||||||
|
- 'Public/**'
|
||||||
|
- 'Resources/**'
|
||||||
|
- 'Package.swift'
|
||||||
|
- 'Package.resolved'
|
||||||
|
- 'Dockerfile'
|
||||||
|
- '.gitea/workflows/build-and-deploy.yml'
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Log in to Container Registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: registry.smpark.in
|
||||||
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||||
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: true
|
||||||
|
tags: registry.smpark.in/smparkin/website:latest
|
||||||
|
cache-from: type=registry,ref=registry.smpark.in/smparkin/website:buildcache
|
||||||
|
cache-to: type=registry,ref=registry.smpark.in/smparkin/website:buildcache,mode=max
|
||||||
|
|
||||||
|
- name: Summary
|
||||||
|
run: |
|
||||||
|
echo "Built and pushed registry.smpark.in/smparkin/website:latest"
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
# Docker Compose file for Vapor
|
|
||||||
#
|
|
||||||
# Install Docker on your system to run and test
|
|
||||||
# your Vapor app in a production-like environment.
|
|
||||||
#
|
|
||||||
# Note: This file is intended for testing and does not
|
|
||||||
# implement best practices for a production deployment.
|
|
||||||
#
|
|
||||||
# Learn more: https://docs.docker.com/compose/reference/
|
|
||||||
#
|
|
||||||
# Build images: docker-compose build
|
|
||||||
# Start app: docker-compose up app
|
|
||||||
# Stop all: docker-compose down
|
|
||||||
#
|
|
||||||
version: '3.7'
|
|
||||||
|
|
||||||
x-shared_environment: &shared_environment
|
|
||||||
LOG_LEVEL: ${LOG_LEVEL:-debug}
|
|
||||||
|
|
||||||
services:
|
|
||||||
app:
|
|
||||||
image: sparkii/smparkin:latest
|
|
||||||
build:
|
|
||||||
context: .
|
|
||||||
environment:
|
|
||||||
<<: *shared_environment
|
|
||||||
ports:
|
|
||||||
- '8888:8888'
|
|
||||||
command: ["serve", "--env", "production", "--hostname", "0.0.0.0", "--port", "8888"]
|
|
||||||
Reference in New Issue
Block a user