Skip to content

internal/functions: make snippets func more robust #179

internal/functions: make snippets func more robust

internal/functions: make snippets func more robust #179

Workflow file for this run

# Code generated internal/ci/ci_tool.cue; DO NOT EDIT.
name: Update tip
"on":
push:
branches:
- master
workflow_dispatch: {}
concurrency: deploy
jobs:
push:
runs-on: ubuntu-22.04
defaults:
run:
shell: bash
if: ${{ github.repository == 'cue-lang/cuelang.org' && (github.event_name != 'repository_dispatch' || github.event.client_payload.type == 'rebuild_tip') }}
steps:
- name: Write netrc file for cueckoo Gerrithub
run: |-
cat <<EOD > ~/.netrc
machine review.gerrithub.io
login cueckoo
password ${{ secrets.CUECKOO_GERRITHUB_PASSWORD }}
EOD
chmod 600 ~/.netrc
- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Reset git directory modification times
run: touch -t 202211302355 $(find * -type d)
- name: Restore git file modification times
uses: chetan/git-restore-mtime-action@075f9bc9d159805603419d50f794bd9f33252ebe
- id: DispatchTrailer
name: Try to extract Dispatch-Trailer
run: |-
x="$(git log -1 --pretty='%(trailers:key=Dispatch-Trailer,valueonly)')"
if [[ "$x" == "" ]]
then
# Some steps rely on the presence or otherwise of the Dispatch-Trailer.
# We know that we don't have a Dispatch-Trailer in this situation,
# hence we use the JSON value null in order to represent that state.
# This means that GitHub expressions can determine whether a Dispatch-Trailer
# is present or not by checking whether the fromJSON() result of the
# output from this step is the JSON value null or not.
x=null
fi
echo "value<<EOD" >> $GITHUB_OUTPUT
echo "$x" >> $GITHUB_OUTPUT
echo "EOD" >> $GITHUB_OUTPUT
- if: |-
((github.ref == 'refs/heads/master' || github.ref == 'refs/heads/alpha') && (! (contains(github.event.head_commit.message, '
Dispatch-Trailer: {"type":"')))) && (contains(github.event.head_commit.message, '
Dispatch-Trailer: {"type":"'))
name: Check we don't have Dispatch-Trailer on a protected branch
run: |-
echo "github.event.head_commit.message contains Dispatch-Trailer"
echo "github.event.head_commit.message value"
cat <<EOD
${{ github.event.head_commit.message }}
EOD
echo "containsDispatchTrailer expression"
cat <<EOD
(contains(github.event.head_commit.message, '
Dispatch-Trailer: {"type":"'))
EOD
false
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 18.17.0
- name: Install Go
uses: actions/setup-go@v4
with:
cache: false
go-version: 1.20.6
- name: Install Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: 0.115.4
extended: true
- id: go-mod-cache-dir
name: Get go mod cache directory
run: echo "dir=$(go env GOMODCACHE)" >> ${GITHUB_OUTPUT}
- id: go-cache-dir
name: Get go build/test cache directory
run: echo "dir=$(go env GOCACHE)" >> ${GITHUB_OUTPUT}
- uses: actions/cache/restore@v3
with:
path: |-
${{ steps.go-mod-cache-dir.outputs.dir }}/cache/download
${{ steps.go-cache-dir.outputs.dir }}
key: Linux-1.20.6-${{ github.run_id }}
restore-keys: Linux-1.20.6
- name: Tip dist
run: ./build.bash
env:
BRANCH: tip
- name: Install Netlify CLI
run: npm install -g [email protected]
- name: Deploy tip
run: netlify deploy -f functions -d _public -m "Deploy tip" -s cue-tip --debug --prod
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN_CUE_TIP }}