This action deploys screeps code via github / gitea actions.
Go to file
Act Runner 3e3d24f787
Lint / pre-commit Linting (push) Successful in 25s Details
Updates to the pre-commit action created at 2024-02-17 (#13)
Update to the pre-commit action.

Co-authored-by: Philipp <Philipp@users.noreply.github.com>
Reviewed-on: #13
Co-authored-by: Act Runner <runner@np-replay-git@horstenkamp.eu>
Co-committed-by: Act Runner <runner@np-replay-git@horstenkamp.eu>
2024-04-25 22:39:28 +02:00
.gitea/workflows Reworked the maintance action to use a PAT 2023-12-09 13:16:49 +01:00
node_modules First development of the deploy action (#6) 2023-11-26 18:31:49 +01:00
.gitignore Reworked the maintance action to use a PAT 2023-12-09 13:16:49 +01:00
.pre-commit-config.yaml Updates to the pre-commit action created at 2024-02-17 (#13) 2024-04-25 22:39:28 +02:00
LICENSE Initial commit 2023-11-24 22:16:32 +01:00
README.md Added the ability to replace some placeholders in the screeps code (#12) 2023-12-25 02:22:42 +01:00
action.yaml Added the ability to replace some placeholders in the screeps code (#12) 2023-12-25 02:22:42 +01:00
index.js Added the ability to replace some placeholders in the screeps code (#12) 2023-12-25 02:22:42 +01:00
package-lock.json First development of the deploy action (#6) 2023-11-26 18:31:49 +01:00
package.json First development of the deploy action (#6) 2023-11-26 18:31:49 +01:00

README.md

screeps-deploy-action

Introduction

This GitHub Action facilitates the uploading of code to a Screeps server. Its designed to automate the process of deploying JavaScript code to your Screeps account, ensuring that your game logic is consistently and efficiently updated. Prerequisites

A Screeps account with an access token.
A GitHub or Gitea repository with your Screeps code.

Usage

To use this action, you need to set it up in your workflow .yml file located in the .github/workflows directory of your repository.

Inputs

  • protocol: The protocol to use (default: https).
  • hostname: The hostname of the Screeps server (default: screeps.com).
  • port: The port to use (default: 443).
  • path: The path for the API (default: /).
  • token: Authentication token for Screeps.
  • username: Username for Screeps account (used if no token is provided).
  • password: Password for Screeps account (used if no token is provided).
  • prefix: Directory prefix for file paths.
  • pattern: Glob pattern to match files (default: *.js).
  • branch: Branch in Screeps to which the code will be uploaded (default: default).
  • git-replace: Overwrite “{{gitRef}}”, “{{gitHash}}” and “{{deployTime}}” values in files matching the pattern.

Example Workflow

Create a .yml file (e.g., screeps-deploy.yml) in your repositorys .github/workflows directory or .gitea/workflows directory:

name: Deploy to Screeps

on: [push]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout
      uses: actions/checkout@v2

    - name: Upload to Screeps
      uses: Screeps/screeps-deploy-action@main
      with:
        token: ${{ secrets.SCREEPS_TOKEN }}
        pattern: '**/*.js'
        branch: 'default'
        git-replace: /some_options.js

In this example:

  • The action runs on every push to the repository.
  • It checks out your code.
  • Then, it uses the “Upload to Screeps” action to deploy the code to your Screeps account.
  • You need to set SCREEPS_TOKEN in your repository secrets.

Advanced Usage

Please note that you can easily filter your deployment branches in the push action. Multiple deploy steps or jobs are recomended for mulitple deployments.