Skip to content

distributeaid/centralised-github-actions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

centralised-github-actions

Centralised Github Actions to be reused for Distribute Aid.

Actions available

PR Title Check

This GitHub Action enforces our naming convention for Pull Request titles, links the Kanban Issue with the PR. It expects issue type/issue number/ description. If we want to bypass it for a PR, we just need to have NOISSUE in the PR title.

Inputs

name description required default
github-token

GitHub token to use for authentication

true N/A

Examples

name: PR Title Check
on:
  pull_request_target:
    types: [opened, edited, reopened, synchronize]

jobs:
  check-title:
    runs-on: ubuntu-latest
    steps:
      - name: Validate PR title and link to Issue
        uses: distributeaid/centralised-github-actions/.github/actions/pr-title-check-linking
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}

Ansible Deploy

This GitHub Action deploys an application to a server by checking out the specified branch, running yarn install and yarn build, and restarting the PM2 service. It connects to the server over SSH using the provided private key.

Inputs

name description required default
host

Server IP to deploy to

true N/A
branch

Branch to check out and deploy

true N/A
repo_name

Repository name — matches the cloned folder name and PM2 service name

true N/A
SSH_PRIVATE_KEY

Deploy SSH private key

true N/A

Examples

name: Deploy

on:
  workflow_dispatch:
    inputs:
      host:
        required: true
        description: "Server IP"
      branch:
        required: true
        description: "Branch to deploy"

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - name: Deploy application
        uses: distributeaid/centralised-github-actions/.github/actions/ansible-deploy@main
        with:
          host: ${{ inputs.host }}
          branch: ${{ inputs.branch }}
          repo_name: aggregated-public-information
          SSH_PRIVATE_KEY: ${{ secrets.DEPLOY_SSH_PRIVATE_KEY }}

About

Centralised Github Actions to be reused for Distribute Aid.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors