Build Joplin Website #4506
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
name: Build Joplin Website | |
on: | |
schedule: | |
- cron: "0 */6 * * *" | |
workflow_dispatch: | |
jobs: | |
# We run the plugin website CI in a separate job that doesn't have | |
# SSH key access for extra security because it handles untrusted markdown. | |
PluginWebsite: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Joplin plugin website repository | |
uses: actions/checkout@v4 | |
with: | |
repository: 'joplin/website-plugin-discovery' | |
ref: main | |
path: 'website-plugin-discovery' | |
- name: Install Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: Build | |
shell: bash | |
run: | | |
corepack enable | |
cd website-plugin-discovery | |
yarn install | |
yarn build-production /plugins | |
cd site | |
# Create a .tar.gz for uploading | |
tar -czvf ../../plugin-website.tar.gz . | |
# Send to the main website workflow. | |
# See https://docs.github.com/en/actions/using-workflows/storing-workflow-data-as-artifacts#passing-data-between-jobs-in-a-workflow | |
- name: Upload built plugins | |
uses: actions/upload-artifact@v4 | |
with: | |
name: plugin-website | |
path: plugin-website.tar.gz | |
retention-days: 1 | |
Main: | |
runs-on: ubuntu-latest | |
needs: PluginWebsite | |
steps: | |
- name: Checkout main Joplin repository | |
uses: actions/checkout@v4 | |
with: | |
repository: 'laurent22/joplin' | |
ref: dev | |
ssh-key: ${{ secrets.JOPLIN_BOT_SSH_PRIVATE_KEY }} | |
path: 'joplin' | |
- name: Checkout Joplin website repository | |
uses: actions/checkout@v4 | |
with: | |
repository: 'joplin/website' | |
ref: master | |
path: 'joplin-website' | |
- name: Download built plugin website | |
uses: actions/download-artifact@v4 | |
with: | |
name: plugin-website | |
- name: Install dependencies | |
run: | | |
sudo apt-get update || true | |
sudo apt-get install -y libsecret-1-dev | |
- name: Install Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: Release website | |
env: | |
GIT_USER_EMAIL: ${{ secrets.GIT_USER_EMAIL }} | |
GIT_USER_NAME: Joplin Bot | |
IS_CONTINUOUS_INTEGRATION: 1 | |
DISCOURSE_API_KEY: ${{ secrets.DISCOURSE_API_KEY }} | |
DISCOURSE_USERNAME: ${{ secrets.DISCOURSE_USERNAME }} | |
JOPLIN_GITHUB_OAUTH_TOKEN: ${{ secrets.JOPLIN_GITHUB_OAUTH_TOKEN }} | |
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} | |
run: | | |
./joplin/packages/tools/release-website.sh | |
- name: Setup Pages | |
uses: actions/configure-pages@v5 | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: 'joplin-website/docs/' | |
Deploy: | |
runs-on: ubuntu-latest | |
needs: Main | |
permissions: | |
# Permissions needed for pages deployment. See | |
# https://github.com/actions/deploy-pages | |
pages: write | |
id-token: write | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |