Skip to content

Commit

A project can build with a workflow. Turning on **Build with a workflow** under Settings, Deployments installs a managed workflow named `g1t` that calls g1t's reusable deploy workflow (`g1t/workflows/.g1t/workflows/deploy.yml@v1`, published from `workflows/` by the actions release) with the project's settings, and pushes and pull requests then start it rather than a build of Deployments' own: the same previews and production, at the same addresses, reported as `g1t / deploy`, now the check of the workflow's job, listed on the Actions page with its runs and logs. A pull request from a fork runs it with a read-only token, as on GitHub, and still gets its preview without the project's build secrets: a read-only job token may open a preview build only from a run of a managed workflow. Fork pull requests run the repository's managed workflows too. Its jobs are Actions time, at cost plus 20% on g1t's machines and free on a self-hosted runner. A workflow named `g1t` in `.g1t/workflows/` takes its place. The deployments and Actions guides say so.

Claude-Session:
https://claude.ai/code/session_01PnwTRSNaC7vEHTAuBzjhrn
Claudeagent and Claudeagentcommitted The first commitBrowse files
2 files+73−00/2 viewed
+56−0
1+# g1t's reusable deploy workflow: what the deploy workflow g1t manages for
2+# a project calls (crates/actions/src/managed.rs), as
3+# `g1t/workflows/.g1t/workflows/deploy.yml@v1`. Any workflow can call it
4+# the same way. It checks out the commit and builds it onto g1t.page with
5+# g1t/deploy: production from the project's production branch, a preview
6+# from a pull request or another branch.
7+#
8+# Its job is named `deploy`, so a caller job named `g1t` reports the
9+# check `g1t / deploy`.
10+name: g1t deploy
11+
12+on:
13+ workflow_call:
14+ inputs:
15+ project:
16+ description: The project's slug; the repository's one project with Deployments on when empty.
17+ type: string
18+ default: ""
19+ root-dir:
20+ description: Where the project is in the repository; the project's own setting when empty.
21+ type: string
22+ default: ""
23+ build-command:
24+ description: What builds it; the project's own setting, else what the build finds.
25+ type: string
26+ default: ""
27+ output-dir:
28+ description: The folder a static build writes; found by itself when empty.
29+ type: string
30+ default: ""
31+ outputs:
32+ url:
33+ description: Where the app is served, on g1t.page.
34+ value: ${{ jobs.deploy.outputs.url }}
35+
36+jobs:
37+ deploy:
38+ name: deploy
39+ runs-on: ubuntu-latest
40+ timeout-minutes: 30
41+ # A pull request from a fork gets a read-only token, as on GitHub; g1t
42+ # still builds its preview, without the project's build secrets.
43+ permissions:
44+ contents: read
45+ deployments: write
46+ outputs:
47+ url: ${{ steps.deploy.outputs.url }}
48+ steps:
49+ - uses: actions/checkout@v5
50+ - id: deploy
51+ uses: g1t/deploy@v1
52+ with:
53+ project: ${{ inputs.project }}
54+ root-dir: ${{ inputs.root-dir }}
55+ build-command: ${{ inputs.build-command }}
56+ output-dir: ${{ inputs.output-dir }}
+17−0
1+# g1t/workflows
2+
3+g1t's own reusable workflows, published from this folder of g1t's
4+repository to `g1t/workflows` on g1t.sh by `.g1t/workflows/actions-release.yml`.
5+
6+| Workflow | What it does |
7+| --- | --- |
8+| `.g1t/workflows/deploy.yml` | Builds the commit onto g1t.page with `g1t/deploy`. The deploy workflow g1t manages for a project calls it. |
9+
10+```yaml
11+jobs:
12+ g1t:
13+ uses: g1t/workflows/.g1t/workflows/deploy.yml@v1
14+ with:
15+ project: web
16+ secrets: inherit
17+```