Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
download

GitHub Action

Deploy your app to GitHub Pages

1.1.0

Deploy your app to GitHub Pages

download

Deploy your app to GitHub Pages

GitHub action that will help deploy your app to the repository for GitHub Pages

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Deploy your app to GitHub Pages

uses: awibox/[email protected]

Learn more about this action in awibox/deploy-to-github-pages-action

Choose a version

Deploy your app to GitHub Pages

Description

You can use GitHub Pages like hosting for your project. To do this, you need to create a repository with the name yourUsername.github.io (GitHub Pages repo). This action will help you set up automatic deployment from your app to another repository (GitHub Pages repo).

Getting started

You should create deploy.yml file using the example below:

name: Deploy to GitHub Pages
on:
  push:
    branches:
      - master
jobs:
  deploy:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        node-version: [13.2.0]
    steps:
      - uses: actions/checkout@master
      - name: install, build, and test
        run: |
          yarn install
          yarn lint
          yarn build
          yarn test
        env:
          CI: true
      - name: Deploy to production
        uses: awibox/[email protected]
        env:
          AUTHOR: awibox
          BUILD_PATH: public
          GITHUB_PAGE_NAME: awibox.github.io
          PA_TOKEN: ${{ secrets.PA_TOKEN }}
          USERNAME: awibox
          EMAIL: [email protected]

Environment variables

Environment variable Required Description Example
AUTHOR Required Name of the repository owner awibox
BUILD_PATH Required The directory where the static is built public
GITHUB_PAGE_NAME Required Name of the repository for GitHub Pages where the application will be collected awibox.github.io
PA_TOKEN Required GitHub Private Access Token with editing rights for repo. You can create it using GitHub Documentation ${{secrets.PA_TOKEN}}
USERNAME Optional The GitHub username for commits. awibox
EMAIL Optional The email that is used for commits. [email protected]