Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relies solely on PHP —no Docker— and deploys artefacts via SSH #13

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 24 additions & 15 deletions .github/workflows/daily.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,37 @@
on:
# to be removed after testing
push:
# on demand via the Actions menu
workflow_dispatch:
# automatically schedluled every two days at 1:00am
schedule:
# everyday at 1am
- cron: '0 1 * * *'
- cron: '0 1 */2 * *'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Copy packager configuration for CI
run: cp local.config.json.sample local.config.json

- name: Setup PHP project
run: docker build -t yeswiki-build-repo .

- name: Generate packages list
- uses: nanasess/[email protected]
with:
php-version: '7.4'

- run: composer install

- name: Copy packager configuration for CI
run: |
docker run --rm -v $(pwd)/dist/:/var/www/html/repository/ yeswiki-build-repo \
php index.php action=init
cp local.config.json.sample local.config.json
mkdir -p /var/www/html/repository/

- name: Deploy on GitHub Pages
uses: peaceiris/actions-gh-pages@v3
- name: Generate packages list
run: php index.php action=init

- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# ./dist is our local folder which got the artifacts back from the 'Generate packages list' step
publish_dir: ./dist/
key: "${{ secrets.SSH_DEPLOY_KEY }}"
# a line starting by `repository.yeswiki.net, …`as it appears in `~/.ssh/known_hosts`
known_hosts: ${{ secrets.SSH_KNOWN_HOSTS }}

- run: rsync -avzr --delete /var/www/html/repository/ [email protected]:/path/to/repository/