Giter VIP home page Giter VIP logo

twinepractice's Introduction

Tweego / VS Code / GitHub Actions Practice Repository

See the compiled result of this repository at www.TwinePractice.ElleYnn.com.

This repo demonstrates compiling multiple Twine files in the src directory of the main branch and deploying the HTML file to a custom domain (or a GitHub Page) via a GitHub Actions workflow.

Using GitHub Actions for compiling Twine games offers several benefits: it ensures a consistent and clean build environment, automates the compilation process for efficiency, facilitates seamless collaboration by handling merging and build processes, keeps the repository tidy by excluding compiled files, enables immediate detection of integration issues, and allows for secure handling of sensitive information through secrets. This automated workflow is scalable, supports continuous integration and delivery, and is adaptable to the growing complexity of game development.

A large part of this project takes inspiration from Em Lazer-Walker's 'A Modern Developer's Workflow For Twine' and 6note's TweeExample repository. Certain portions of these examples have depreciated since their publication, so I have created an alternative workflow that does not use the Go Environment since Tweego does not currently support Go modules. Instead, this workflow uses jq for JSON processing and the GitHub API to grab the latest precompiled version of Tweego.

Workflow Setup

Step 1: Configure Workflow Permissions

Before using the provided build.yaml file, make sure your GitHub Actions are configured with the appropriate permissions:

  1. Navigate to your repository on GitHub.
  2. Go to Settings > Actions > General.
  3. Under Workflow permissions, make sure the following are set:
    • Turn on 'Allow GitHub Actions to create and approve pull requests'.
    • Select the 'Read and write permissions' option.

Step 2: Set Repository Variables

Set up the necessary repository variables for your GitHub Actions workflow:

  1. Go to your repository's Settings > Secrets and variables > Actions.
  2. Create the following repository variables:
    • OUTPUT_DIRECTORY: Set this to dist (or your preferred output directory for the compiled game).
    • OUTPUT_FILENAME: Set this to index.html (or your preferred name for the compiled game file).

Step 3: Add a GitHub Personal Access Token

Create a GitHub Personal Access Token (PAT) to allow your workflow to authenticate with the GitHub API:

  1. Visit GitHub Personal Access Tokens page and log in to your account.
  2. Click Generate new token.
  3. Provide a descriptive name for your token.
  4. Under scopes, select public_repo if your repository is public. Adjust scopes as needed for private repositories.
  5. Click Generate token.
  6. Copy the generated token.

Step 4: Add the Personal Access Token to Your Repository Secrets

Add your GitHub Personal Access Token to your repository secrets:

  1. Go to your repository's Settings > Secrets and variables > Actions.
  2. Click New repository secret.
  3. Name the secret PERSONAL_TOKEN and paste your PAT into the value field.
  4. Click Add secret.

Step 5: Customize the build.yaml File

Adjust the build.yaml file as needed. Set the cname field to your custom domain if applicable, or remove the line if not using a custom domain.

Using the Workflow

Once set up, any push to the main branch will trigger the build and deployment of your project. Your game will be built using the latest version of Tweego and published to GitHub Pages.

Further Assistance

If you encounter any issues or need further assistance, please refer to the GitHub Actions documentation or raise an issue in this repository.

twinepractice's People

Contributors

elleynn avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.