Skip to content

Commit 473055b

Browse files
authored
Create test-ubuntu-git Docker Container for Proxy Tests (#1616)
1 parent b4ffde6 commit 473055b

File tree

2 files changed

+66
-0
lines changed

2 files changed

+66
-0
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Publishes the test-ubuntu-git Container Image
2+
3+
on:
4+
# Use an on demand workflow trigger.
5+
# (Forked copies of actions/checkout won't have permission to update GHCR.io/actions,
6+
# so avoid trigger events that run automatically.)
7+
workflow_dispatch:
8+
inputs:
9+
publish:
10+
description: 'Publish to ghcr.io?'
11+
type: boolean
12+
required: true
13+
default: false
14+
15+
env:
16+
REGISTRY: ghcr.io
17+
IMAGE_NAME: actions/test-ubuntu-git
18+
19+
jobs:
20+
build-and-push-image:
21+
runs-on: ubuntu-latest
22+
# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.
23+
permissions:
24+
contents: read
25+
packages: write
26+
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v4
30+
31+
# Use `docker/login-action` to log in to GHCR.io.
32+
# Once published, the packages are scoped to the account defined here.
33+
- name: Log in to the ghcr.io container registry
34+
uses: docker/login-action@v3.0.0
35+
with:
36+
registry: ${{ env.REGISTRY }}
37+
username: ${{ github.actor }}
38+
password: ${{ secrets.GITHUB_TOKEN }}
39+
40+
# Use `docker/metadata-action` to preserve tags and labels that exist on the GHCR.io container image.
41+
# - name: Extract metadata (tags, labels) for Docker
42+
# id: meta
43+
# uses: docker/metadata-action@v5.5.1
44+
# with:
45+
# images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
46+
47+
# Use `docker/build-push-action` to build (and optionally publish) the image.
48+
- name: Build and push Docker image
49+
uses: docker/build-push-action@v5.1.0
50+
with:
51+
context: .
52+
file: images/test-ubuntu-git.Dockerfile
53+
push: ${{ inputs.publish }}
54+
tags: ${{ env.IMAGE_NAME }}:sha-${{ env.GITHUB_SHA }}
55+
# tags: ${{ steps.meta.outputs.tags }}
56+
# labels: ${{ steps.meta.outputs.labels }}

images/test-ubuntu-git.Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Defines the test-ubuntu-git Container Image.
2+
# Consumed by actions/checkout CI/CD validation workflows.
3+
4+
FROM ubuntu:latest
5+
6+
RUN apt update
7+
RUN apt install -y git
8+
9+
LABEL org.opencontainers.image.description="Ubuntu image with git pre-installed"
10+
LABEL org.opencontainers.image.licenses=MIT

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy