Skip to content

ci: add publish to CF pages #41

ci: add publish to CF pages

ci: add publish to CF pages #41

Workflow file for this run

name: CI
on: [push, pull_request]
jobs:
Build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
bundler-cache: true
- name: Install i18n dependencies
run: |
sudo apt-get update
sudo apt-get install translate-toolkit
- name: Build website
run: |
scripts/build.sh
- name: Publish to Cloudflare Pages
if: ${{ github.event_name == 'push' && github.repository == 'ubuntu-mate/start.ubuntu-mate.org' && github.ref == 'refs/heads/master' }}
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: e6fe5e31e8183c8192347f15af553766
projectName: start-ubuntu-mate-org
directory: _site
# Optional: Enable this if you want to have GitHub Deployments triggered
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
- name: Deploy to server
if: ${{ github.event_name == 'push' && github.repository == 'ubuntu-mate/start.ubuntu-mate.org' && github.ref == 'refs/heads/master' }}
run: |
mkdir -p $HOME/.ssh/
chmod 700 $HOME/.ssh/
echo -n "${{ secrets.SSH_MATEY }}" > $HOME/.ssh/id_rsa
chmod 600 $HOME/.ssh/id_rsa
scripts/deploy.sh