mirror of https://github.com/buildpacks/docs.git
71 lines
1.8 KiB
YAML
71 lines
1.8 KiB
YAML
name: Build
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
repository_dispatch:
|
|
types:
|
|
- pack-release
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Git Checkout
|
|
uses: actions/checkout@v4
|
|
- name: Setup Go environment
|
|
uses: actions/setup-go@v6
|
|
with:
|
|
go-version: '1.x'
|
|
# Node is used to generate the pagefind index
|
|
- name: Setup Node.js environment
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: 'latest'
|
|
- name: Install Dependencies
|
|
run: sudo apt-get install make curl jq
|
|
- name: Install pack
|
|
uses: buildpacks/github-actions/setup-pack@v5.9.5
|
|
with:
|
|
pack-version: '0.38.2'
|
|
- name: Test
|
|
run: make test
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: Build
|
|
run: make build
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: Check links
|
|
run: |
|
|
make check-links
|
|
- name: Upload public folder
|
|
uses: actions/upload-artifact@v5
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
name: public
|
|
path: ./public
|
|
|
|
deploy:
|
|
if: (github.event_name == 'repository_dispatch') || (github.event_name == 'push' && github.ref == 'refs/heads/main')
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Download public folder
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: public
|
|
path: ./public
|
|
- name: Deploy
|
|
uses: peaceiris/actions-gh-pages@v4
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
publish_dir: ./public
|
|
cname: buildpacks.io
|
|
full_commit_message: ${{ github.event.head_commit.message }}
|