#!/bin/bash
# Variables
REPO_NAME="memecoin-project"
DESCRIPTION="Enable quick memecoinery, create and make them available"
PRIVATE=true
GITHUB_USERNAME="your-github-username"
PUBLISH_DIR="./public"
# Create a new private repository
gh repo create $REPO_NAME --$PRIVATE --description "$DESCRIPTION" --homepage "https://www.memecoin.dev" --confirm
# Clone the repository
git clone git@github.com:$GITHUB_USERNAME/$REPO_NAME.git
cd $REPO_NAME
# Initialize Git
git init
echo "# $REPO_NAME" > README.md
git add README.md
git commit -m "Initial commit"
git branch -M main
git remote add origin git@github.com:$GITHUB_USERNAME/$REPO_NAME.git
git push -u origin main
# Create GitHub Pages branch
gh api -X POST repos/$GITHUB_USERNAME/$REPO_NAME/pages --field source='{"branch": "main", "path": "/"}'
# Create GitHub Actions workflow
mkdir -p .github/workflows
cat <<EOL > .github/workflows/deploy.yml
name: Deploy to GitHub Pages
on:
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Install Dependencies
run: npm install
- name: Build Project
run: npm run build
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: \${{ secrets.GITHUB_TOKEN }}
publish_dir: $PUBLISH_DIR
EOL
# Commit and push the workflow
git add .github/workflows/deploy.yml
git commit -m "Add GitHub Actions workflow for deployment"
git push origin main
echo "Repository $REPO_NAME created and configured successfully."