publish on push #846
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: | |
- main # trigger the workflow when changes are pushed on the `main` branch | |
schedule: | |
- cron: '30 7 * * *' # trigger every day at 00:30 ex 12:30 am | |
workflow_dispatch: # allow the ability to trigger the workflow manually | |
name: publish on push | |
concurrency: | |
group: ${{ github.ref }} | |
cancel-in-progress: true # this workflow stops other concurrent workflows from running | |
jobs: | |
build: | |
name: Jekyll build and push | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 # checks-out your repository under $GITHUB_WORKSPACE, so the workflow can access it | |
with: | |
ref: main # pull code from the "main" branch | |
- uses: ./ # run the Dockerfile, which can call entrypoint.sh the assumed filename to start is "Dockerfile" with a capital D | |
env: | |
USER_SITE_REPOSITORY: BillRaymond/agile-in-action-podcast-website # target repo that hosts the Jekyll website | |
GITHUB_TOKEN: ${{ secrets.JEKYLLNEW_PAT }} #personal access token of the source repository | |
## How to install this workflow | |
# 1. Place this file in the root of your Jekyll repo /.github/workflows | |
# 2. Create a new personal access token (PAT) in GitHub | |
# Github->Your account->Setttings->Developer settings-> | |
# Personal access tokens (old)->"JEKYLL_PAT" (or something similar) | |
# Select: "Repo" (all items) and "Workflow" | |
# Note: If you are forced to use the new token, allow access to the | |
# source and target repos and use the same settings as defined above | |
# 3. Copy the generated token to your clipboard | |
# 4. Add the the token to your source repo | |
# Github->Repositories->[your repo]->Settings-> | |
# Secrets->Actions->New repository secret-> | |
# Name: same as the PAT (ex JEKYLL_PAT) | |
# Value: Paste the generated token into the value |