forked from TryGhost/Ghost
-
Notifications
You must be signed in to change notification settings - Fork 1
70 lines (62 loc) · 2.29 KB
/
devcontainer-build.yml
File metadata and controls
70 lines (62 loc) · 2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: Devcontainer image
# Builds the dev container base image used by .devcontainer/devcontainer.json
# (VS Code Dev Containers + GitHub Codespaces) and publishes it to GHCR.
#
# Triggers only on push to main (path-filtered) and manual dispatch. PRs
# don't trigger this workflow — devcontainer.json references the :latest
# tag, so pre-publishing per-PR images would just produce unused tags.
# A broken Dockerfile change in a PR will surface when the merge to main
# fires this workflow; the previously-good :latest stays in place until
# the next successful run.
on:
workflow_dispatch:
push:
branches: [main]
paths:
- 'docker/ghost-dev/**'
- '.github/workflows/devcontainer-build.yml'
- '.github/scripts/**'
- '.github/hooks/**'
- 'package.json'
- 'pnpm-lock.yaml'
- 'pnpm-workspace.yaml'
- '.npmrc'
- 'ghost/core/package.json'
- 'ghost/i18n/package.json'
- 'ghost/parse-email-address/package.json'
permissions:
contents: read
packages: write
jobs:
publish:
name: Build & push
runs-on: ubuntu-latest
if: github.repository == 'TryGhost/Ghost' && github.ref == 'refs/heads/main'
concurrency:
group: devcontainer-image-${{ github.ref }}
cancel-in-progress: true
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up QEMU
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4
- name: Login to GHCR
uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build & push
uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7
with:
context: .
file: docker/ghost-dev/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/tryghost/ghost-devcontainer:latest
ghcr.io/tryghost/ghost-devcontainer:${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max