Adding Dockerfile and gitea actions
This commit is contained in:
parent
5ba8f6d880
commit
3771c1b16f
60
.gitea/workflows/build.yaml
Normal file
60
.gitea/workflows/build.yaml
Normal 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
2
Dockerfile
Normal file
@ -0,0 +1,2 @@
|
||||
FROM nginx:1.21.1-alpine
|
||||
COPY ./build/web /usr/share/nginx/html
|
Loading…
Reference in New Issue
Block a user