Skip to content

article: write about unpublished software named star #121

article: write about unpublished software named star

article: write about unpublished software named star #121

Workflow file for this run

name: CI
on:
push:
jobs:
test:
name: Unit Test
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v5
with:
go-version: 1.21.x
- uses: actions/checkout@v4
- run: cd builder && go test -race ./...
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v5
with:
go-version: 1.21.x
- name: Checkout base branch
if: ${{ github.ref != 'refs/heads/photos' }}
uses: actions/checkout@v4
- name: Checkout master branch
if: ${{ github.ref == 'refs/heads/photos' }}
uses: actions/checkout@v4
with:
ref: master
- name: Checkout photos branch
uses: actions/checkout@v4
with:
ref: photos
path: pages/photos
- name: Cache assets
uses: actions/cache@v4
with:
path: .vercel/cache
key: build-cache-${{ hashFiles('pages/photos/**/*.jpg') }}
restore-keys: |
build-cache-${{ hashFiles('pages/photos/**/*.jpg') }}
build-cache-
- name: Build pages
run: ./make build
- name: Save artifact
uses: actions/upload-artifact@v4
with:
name: dist
path: .vercel/output/
lighthouse:
name: Lighthouse Test
runs-on: ubuntu-latest
needs: [build]
if: ${{ github.ref != 'refs/heads/photos' }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Load artifact
uses: actions/download-artifact@v4
with:
name: dist
path: .vercel/output/
- uses: treosh/lighthouse-ci-action@v11
with:
configPath: .github/lighthouse.json
runs: 3
urls: |
/
/blog
/blog/2020/05/blanktar-renewal
/blog/2023/08/golang-goldmark-custom-renderer
/works
/photos
uploadArtifacts: true
preview:
name: Preview Deploy
runs-on: ubuntu-latest
needs: [test, build]
if: ${{ github.ref != 'refs/heads/master' && github.ref != 'refs/heads/photos' }}
environment:
name: preview
url: ${{ steps.deploy.outputs.url }}
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
steps:
- name: Instal Vercel CLI
run: npm install --global vercel@latest
- name: Checkout repository
uses: actions/checkout@v4
- name: Load artifact
uses: actions/download-artifact@v4
with:
name: dist
path: .vercel/output/
- name: Pull Vercel environment information
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy to Vercel
id: deploy
run: |
echo -n "url=" >> $GITHUB_OUTPUT
vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }} >> $GITHUB_OUTPUT
production:
name: Production Deploy
runs-on: ubuntu-latest
needs: [test, lighthouse, build]
if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/photos' }}
environment:
name: production
url: ${{ steps.deploy.outputs.url }}
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
steps:
- name: Instal Vercel CLI
run: npm install --global vercel@latest
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: master
- name: Load artifact
uses: actions/download-artifact@v4
with:
name: dist
path: .vercel/output/
- name: Pull Vercel environment information
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy to Vercel
id: deploy
run: |
echo -n "url=" >> $GITHUB_OUTPUT
vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }} --prod >> $GITHUB_OUTPUT