Skip to content

Commit

Permalink
Merge pull request #1 from devsticks/dev
Browse files Browse the repository at this point in the history
v1.0.0
  • Loading branch information
devsticks authored Aug 3, 2024
2 parents c9a5bae + 439f34f commit 9493f3c
Show file tree
Hide file tree
Showing 6 changed files with 236 additions and 141 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Deploy to GitHub Pages

on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: 'stable'

- name: Run Makefile Deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: make deploy OUTPUT=rostrem-website
29 changes: 7 additions & 22 deletions .metadata
Original file line number Diff line number Diff line change
@@ -1,38 +1,23 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled.
# This file should be version controlled and should not be manually edited.

version:
revision: 62bd79521d8d007524e351747471ba66696fc2d4
channel: stable
revision: "b0850beeb25f6d5b10426284f506557f66181b36"
channel: "stable"

project_type: app

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: 62bd79521d8d007524e351747471ba66696fc2d4
base_revision: 62bd79521d8d007524e351747471ba66696fc2d4
- platform: android
create_revision: 62bd79521d8d007524e351747471ba66696fc2d4
base_revision: 62bd79521d8d007524e351747471ba66696fc2d4
- platform: ios
create_revision: 62bd79521d8d007524e351747471ba66696fc2d4
base_revision: 62bd79521d8d007524e351747471ba66696fc2d4
- platform: linux
create_revision: 62bd79521d8d007524e351747471ba66696fc2d4
base_revision: 62bd79521d8d007524e351747471ba66696fc2d4
- platform: macos
create_revision: 62bd79521d8d007524e351747471ba66696fc2d4
base_revision: 62bd79521d8d007524e351747471ba66696fc2d4
create_revision: b0850beeb25f6d5b10426284f506557f66181b36
base_revision: b0850beeb25f6d5b10426284f506557f66181b36
- platform: web
create_revision: 62bd79521d8d007524e351747471ba66696fc2d4
base_revision: 62bd79521d8d007524e351747471ba66696fc2d4
- platform: windows
create_revision: 62bd79521d8d007524e351747471ba66696fc2d4
base_revision: 62bd79521d8d007524e351747471ba66696fc2d4
create_revision: b0850beeb25f6d5b10426284f506557f66181b36
base_revision: b0850beeb25f6d5b10426284f506557f66181b36

# User provided section

Expand Down
39 changes: 39 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Makefile for deploying the Flutter web projects to GitHub
# from https://codewithandrea.com/articles/flutter-web-github-pages/

BASE_HREF = /$(OUTPUT)/
GITHUB_USER = devsticks
GITHUB_REPO = https://github.com/$(GITHUB_USER)/$(OUTPUT)
BUILD_VERSION := $(shell grep 'version:' pubspec.yaml | awk '{print $$2}')

# Deploy the Flutter web project to GitHub
deploy:
ifndef OUTPUT
$(error OUTPUT is not set. Usage: make deploy OUTPUT=<output_repo_name>)
endif

@echo "Clean existing repository"
flutter clean

@echo "Getting packages..."
flutter pub get

@echo "Generating the web folder..."
flutter create . --platform web

@echo "Building for web..."
flutter build web --base-href $(BASE_HREF) --release

@echo "Deploying to git repository"
cd build/web && \
git init && \
git add . && \
git commit -m "Deploy Version $(BUILD_VERSION)" && \
git branch -M main && \
git remote add origin $(GITHUB_REPO) && \
git push -u -f origin main

@echo "✅ Finished deploy: $(GITHUB_REPO)"
@echo "🚀 Flutter web URL: https://$(GITHUB_USER).github.io/$(OUTPUT)/"

.PHONY: deploy
Loading

0 comments on commit 9493f3c

Please sign in to comment.