Skip to content

lepetitglacon/vue-forgejo-actions

Repository files navigation

Forgejo actions

This app is a POC / Tutorial to run Forgero Actions on a Vue app, in Docker, for Windows

Prerequisite

  • Docker Desktop
  • Go
  • A server to run Forgejo on
  • A testing server (will be your own machine in this tutorial)

Network Infrastructure

img.png

Install Forgejo

  1. Pull the docker image docker pull codeberg.org/forgejo/forgejo:8.0.3
  2. Create a container with the image and set the port to 3000
  3. Run the container and go to localhost:3000
  4. Create the instance, set admin user settings
  5. Create an organization
  6. Create a repository
  7. Activate Actions

Install the Forgejo Action Runner

Installation

These steps should be done on your testing server (a separated one from your Forgejo server)

  • clone the runner repository https://code.forgejo.org/forgejo/runner
  • [optional] either stay on main branch or checkout the last tag $ git checkout v3.5.1
  • run $ cd runner
  • run $ go build for windows user Go should be installed on your machine. For linux users you can directly start the .sh file in the tag release

Register the runner

Connect the runner to the forgejo server

Start the runner

The runner will pull tasks from the Forgejo server and execute them

  • run $ ./act_runner daemon

Setup actions for your repository

Create actions jobs

In your git repository, create a folder .forgejo/workflow/
Inside create a file test_actions.yaml

# your_repo/.forgejo/workflows/test_actions.yaml

name: Forgejo Action CI
on:
  push:
    branches: [ main ]
    
jobs:
  unit-tests:
    runs-on: docker
    steps:
      - name: Setup node
        uses: actions/setup-node@v4
      - name: Check out repository code
        uses: actions/checkout@v4
      - name: npm install
        run: 'npm ci'
      - name: Unit test
        run: 'npm run test:unit'

  cypress-e2e:
    runs-on: docker
    needs: unit-tests
    container:
      image: cypress/base
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: Cypress run
        uses: cypress-io/github-action@v6
        with:
          build: npm run build
          start: npm run preview
          browser: electron # or chrome, depends on your container image

See the results

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published