Giter Club home page Giter Club logo

pgs-action's Introduction

pgs-action

Github Action to publish static sites to pgs.sh.

Required params

  • user: SSH User name
  • key: Private key
  • src: Source dir to deploy
  • project: Project name
  • promote: Once the files have been uploaded to project we will promote it by symbolically linking this project to it
  • retain: Removes all projects except the last (3) recently updated projects that match prefix provided

To publish

You will need to copy your ssh private key into a secret in your github repo. This means your key will be accessible from github. It is highly recommended that you create a separate key specifically for pico services that way you can quickly log into pico and remove the key if there's a breach on github.

https://pico.sh/faq#can-i-associate-multiple-ssh-keypairs-to-a-single-account

Usage - Basic

name: ci

on:
  push:
    branches:
      - main

jobs:
  build:
    runs-on: ubuntu-latest
    name: Build and Deploy

    steps:
      - uses: actions/checkout@master
      - name: publish to pgs
        uses: picosh/pgs-action@v3
        with: 
          user: erock 
          key: ${{ secrets.PRIVATE_KEY }}
          # trailing slash is important (we use rsync)
          src: './public/'
          # update or create a new project on-the-fly
          project: 'neovimcraft'

Usage - Site promotion and retention policy

name: ci

on:
  push:
    branches:
      - main

jobs:
  build:
    runs-on: ubuntu-latest
    name: Build and Deploy

    steps:
      - uses: actions/checkout@master

      - name: Set outputs
        id: vars
        run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
      - name: publish to pgs
        uses: picosh/pgs-action@v3
        with: 
          user: erock 
          key: ${{ secrets.PRIVATE_KEY }}
          # trailing slash is important (we use rsync)
          src: './public/'
          # create a new project on-the-fly using git commit hash
          project: 'neovimcraft-${{ steps.vars.outputs.sha_short }}'
          # once the files have been uploaded to the project above, promote the
          # production project by symbolically linking to the project we just created
          promote: 'neovimcraft'
          # keep the latest (N) updated projects matching prefix provided and delete the rest
          retain: 'neovimcraft-'
          # retention policy: num of recently updated projects to keep
          retain_num: 1

pgs-action's People

Contributors

neurosnap avatar

Stargazers

David avatar Lindemberg Barbosa avatar StepBroBD avatar  avatar

Watchers

Antonio Mika 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.