Skip to content

Build

Build #4

Workflow file for this run

name: build
on:
push:
branches: [master]
workflow_dispatch:
workflow_call:
concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true
# This job requires deploy keys to be added to target repositories (https://docs.github.com/en/authentication/connecting-to-github-with-ssh/managing-deploy-keys)
# Generate deploy keys locally:
# $ ssh-keygen -t rsa -f awesome-selfhosted-deploy-key -C awesome-selfhosted-deploy-key
# $ ssh-keygen -t rsa -f awesome-selfhosted-html-deploy-key -C awesome-selfhosted-html-deploy-key
# Paste the contents of awesome-selfhosted-deploy-key.pub to https://github.com/awesome-selfhosted/awesome-selfhosted/settings/keys/new, name: awesome-selfhosted-deploy-key, allow write access
# Paste the contents of awesome-selfhosted-html-deploy-key.pub to https://github.com/awesome-selfhosted/awesome-selfhosted-html/settings/keys/new, name: awesome-selfhosted-html-deploy-key, allow write access
# Access https://github.com/njiticc/awesome-nicc/settings/environments, create new environment with name: production
# - deployment branches: selected branches
# - add deployment branch rule: branch name pattern: master
# - environment secrets: add secret with name: SSH_DEPLOY_KEY, and value: paste the contents of awesome-selfhosted-html-deploy-key
jobs:
build-markdown:
environment:
name: production
url: https://github.com/njiticc/awesome-nicc
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
- run: make install
# - run: make awesome_lint TODO: Fix this for NICC.
- run: make export_markdown
- name: setup markdown repository SSH deploy key
run: |
mkdir -p ~/.ssh
echo "${{ secrets.SSH_DEPLOY_KEY }}" > ~/.ssh/id_rsa
chmod 0600 ~/.ssh/id_rsa
- run: make push_markdown
build-html:
needs: build-markdown
environment:
name: production
url: https://github.com/njiticc/awesome-nicc
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
- run: make install
# - run: make awesome_lint TODO: Fix this for NICC.
- run: make export_html
- name: setup HTML repository SSH deploy key
run: |
mkdir -p ~/.ssh
echo "${{ secrets.SSH_DEPLOY_KEY }}" > ~/.ssh/id_rsa
chmod 0600 ~/.ssh/id_rsa
- run: make push_html