Skip to content
This repository was archived by the owner on Jun 9, 2025. It is now read-only.

Commit 6ecfd30

Browse files
committed
initial commit
0 parents  commit 6ecfd30

File tree

3 files changed

+98
-0
lines changed

3 files changed

+98
-0
lines changed
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: Docker
2+
3+
# This workflow uses actions that are not certified by GitHub.
4+
# They are provided by a third-party and are governed by
5+
# separate terms of service, privacy policy, and support
6+
# documentation.
7+
8+
on:
9+
schedule:
10+
- cron: '39 6 * * 1'
11+
push:
12+
branches: [ "main" ]
13+
# Publish semver tags as releases.
14+
tags: [ 'v*.*.*' ]
15+
pull_request:
16+
branches: [ "main" ]
17+
18+
env:
19+
# Use docker.io for Docker Hub if empty
20+
REGISTRY: ghcr.io
21+
# github.repository as <account>/<repo>
22+
IMAGE_NAME: ${{ github.repository }}
23+
24+
jobs:
25+
build:
26+
27+
runs-on: ubuntu-latest
28+
permissions:
29+
contents: read
30+
packages: write
31+
# This is used to complete the identity challenge
32+
# with sigstore/fulcio when running outside of PRs.
33+
id-token: write
34+
35+
steps:
36+
- name: Checkout repository
37+
uses: actions/checkout@v3
38+
39+
# Install the cosign tool except on PR
40+
# https://github.com/sigstore/cosign-installer
41+
- name: Install cosign
42+
if: github.event_name != 'pull_request'
43+
uses: sigstore/cosign-installer@v3.3.0
44+
45+
# Set up BuildKit Docker container builder to be able to build
46+
# multi-platform images and export cache
47+
# https://github.com/docker/setup-buildx-action
48+
- name: Set up Docker Buildx
49+
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
50+
51+
# Login against a Docker registry except on PR
52+
# https://github.com/docker/login-action
53+
- name: Log into registry ${{ env.REGISTRY }}
54+
if: github.event_name != 'pull_request'
55+
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
56+
with:
57+
registry: ${{ env.REGISTRY }}
58+
username: ${{ github.actor }}
59+
password: ${{ secrets.GITHUB_TOKEN }}
60+
61+
# Extract metadata (tags, labels) for Docker
62+
# https://github.com/docker/metadata-action
63+
- name: Extract Docker metadata
64+
id: meta
65+
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0
66+
with:
67+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
68+
69+
# Build and push Docker image with Buildx (don't push on PR)
70+
# https://github.com/docker/build-push-action
71+
- name: Build and push Docker image
72+
id: build-and-push
73+
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
74+
with:
75+
context: .
76+
platforms: linux/amd64,linux/arm64
77+
push: ${{ github.event_name != 'pull_request' }}
78+
tags: ${{ steps.meta.outputs.tags }}
79+
labels: ${{ steps.meta.outputs.labels }}
80+
cache-from: type=gha
81+
cache-to: type=gha,mode=max
82+
83+
# Sign the resulting Docker image digest except on PRs.
84+
# This will only write to the public Rekor transparency log when the Docker
85+
# repository is public to avoid leaking data. If you would like to publish
86+
# transparency data even for private images, pass --force to cosign below.
87+
# https://github.com/sigstore/cosign
88+
- name: Sign the published Docker image
89+
if: ${{ github.event_name != 'pull_request' }}
90+
env:
91+
# https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
92+
TAGS: ${{ steps.meta.outputs.tags }}
93+
DIGEST: ${{ steps.build-and-push.outputs.digest }}
94+
# This step uses the identity token to provision an ephemeral certificate
95+
# against the sigstore community Fulcio instance.
96+
run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
FROM ghcr.io/uceap/devcontainer-drupal:v2.3.0

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
A docker image supporting [GitHub Codespaces](https://github.com/features/codespaces) and [local devcontainers](https://containers.dev) for a specific UCEAP Drupal project, based on the [UCEAP Drupal devcontainer image](https://github.com/UCEAP/drupal-dev).

0 commit comments

Comments
 (0)