mirror of
https://github.com/hunvreus/basecoat.git
synced 2026-11-11 04:38:18 +00:00
Co-authored-by: boratatouille <178141691+boratatouille@users.noreply.github.com>
34 lines
871 B
YAML
34 lines
871 B
YAML
name: Deploy site on release
|
|
|
|
# Cloudflare Workers Builds deploys the site from the `release` branch.
|
|
# Publishing a GitHub release moves `release` to the released tag.
|
|
|
|
on:
|
|
release:
|
|
types: [published]
|
|
workflow_dispatch:
|
|
inputs:
|
|
tag:
|
|
description: Tag to deploy (for example 1.1.0)
|
|
required: true
|
|
type: string
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
move-release-branch:
|
|
runs-on: ubuntu-latest
|
|
if: github.event_name == 'workflow_dispatch' || github.event.release.prerelease == false
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Point release branch at tag
|
|
env:
|
|
TAG: ${{ inputs.tag || github.event.release.tag_name }}
|
|
run: |
|
|
SHA=$(git rev-parse "refs/tags/$TAG^{commit}")
|
|
git push --force origin "$SHA:refs/heads/release"
|