123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- 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/awesome-selfhosted/awesome-selfhosted-data/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_MARKDOWN_DEPLOY_KEY, and value: paste the contents of awesome-selfhosted-deploy-key
- # - environment secrets: add secret with name: SSH_HTML_DEPLOY_KEY, and value: paste the contents of awesome-selfhosted-html-deploy-key
- jobs:
- build-markdown:
- environment:
- name: production
- url: https://github.com/awesome-selfhosted/awesome-selfhosted
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- with:
- ref: ${{ github.ref }}
- - run: make install
- - run: make awesome_lint
- - run: make export_markdown
- - name: setup markdown repository SSH deploy key
- run: |
- mkdir -p ~/.ssh
- echo "${{ secrets.SSH_MARKDOWN_DEPLOY_KEY }}" > ~/.ssh/id_rsa
- chmod 0600 ~/.ssh/id_rsa
- - run: make push_markdown
- build-html:
- environment:
- name: production
- url: https://github.com/awesome-selfhosted/awesome-selfhosted-html
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- with:
- ref: ${{ github.ref }}
- - run: make install
- - run: make awesome_lint
- - run: make export_html
- - name: setup HTML repository SSH deploy key
- run: |
- mkdir -p ~/.ssh
- echo "${{ secrets.SSH_HTML_DEPLOY_KEY }}" > ~/.ssh/id_rsa
- chmod 0600 ~/.ssh/id_rsa
- - run: make push_html
|