Adding Dockerfile and gitea actions

This commit is contained in:
whysman 2024-11-05 23:35:32 -05:00
parent 5ba8f6d880
commit 3771c1b16f
2 changed files with 62 additions and 0 deletions

View File

@ -0,0 +1,60 @@
name: Build Flutter Web and Docker Image for Local Registry
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
name: Build Flutter Web App
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Flutter
run: |
sudo apt-get update
sudo apt-get install -y curl
curl -o flutter.tar.xz https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.7.7-stable.tar.xz
tar xf flutter.tar.xz
export PATH="$PATH:`pwd`/flutter/bin"
flutter doctor
- name: Flutter Pub Get
run: |
flutter pub get
- name: Build Flutter Web
run: |
flutter build web --release
- name: List Web Build Output
run: |
ls -l build/web
docker:
name: Build and Push Docker Image to Local Registry
runs-on: ubuntu-latest
needs: build # Ensure this job runs after the build job
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Copy Flutter Web Build Files
run: |
cp -r build/web ./web
- name: Build Docker Image
run: |
docker build -t pogdark:latest .
- name: Push Docker Image to Local Registry
run: |
docker push pogdark:latest

2
Dockerfile Normal file
View File

@ -0,0 +1,2 @@
FROM nginx:1.21.1-alpine
COPY ./build/web /usr/share/nginx/html