-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create
test-ubuntu-git
Docker Container for Proxy Tests (#1616)
- Loading branch information
Showing
2 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Publishes the test-ubuntu-git Container Image | ||
|
||
on: | ||
# Use an on demand workflow trigger. | ||
# (Forked copies of actions/checkout won't have permission to update GHCR.io/actions, | ||
# so avoid trigger events that run automatically.) | ||
workflow_dispatch: | ||
inputs: | ||
publish: | ||
description: 'Publish to ghcr.io?' | ||
type: boolean | ||
required: true | ||
default: false | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: actions/test-ubuntu-git | ||
|
||
jobs: | ||
build-and-push-image: | ||
runs-on: ubuntu-latest | ||
# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job. | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
# Use `docker/login-action` to log in to GHCR.io. | ||
# Once published, the packages are scoped to the account defined here. | ||
- name: Log in to the ghcr.io container registry | ||
uses: docker/[email protected] | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# Use `docker/metadata-action` to preserve tags and labels that exist on the GHCR.io container image. | ||
# - name: Extract metadata (tags, labels) for Docker | ||
# id: meta | ||
# uses: docker/[email protected] | ||
# with: | ||
# images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
|
||
# Use `docker/build-push-action` to build (and optionally publish) the image. | ||
- name: Build and push Docker image | ||
uses: docker/[email protected] | ||
with: | ||
context: . | ||
file: images/test-ubuntu-git.Dockerfile | ||
push: ${{ inputs.publish }} | ||
tags: ${{ env.IMAGE_NAME }}:sha-${{ env.GITHUB_SHA }} | ||
# tags: ${{ steps.meta.outputs.tags }} | ||
# labels: ${{ steps.meta.outputs.labels }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Defines the test-ubuntu-git Container Image. | ||
# Consumed by actions/checkout CI/CD validation workflows. | ||
|
||
FROM ubuntu:latest | ||
|
||
RUN apt update | ||
RUN apt install -y git | ||
|
||
LABEL org.opencontainers.image.description="Ubuntu image with git pre-installed" | ||
LABEL org.opencontainers.image.licenses=MIT |