mirror of
https://github.com/actions/checkout.git
synced 2024-12-28 00:41:02 +08:00
9a9194f871
Some checks failed
Check dist / check-dist (push) Successful in 39s
Licensed / Check licenses (push) Successful in 1m6s
Build and Test / build (push) Failing after 21s
Build and Test / test (ubuntu-latest) (push) Failing after 1m32s
Build and Test / test-proxy (push) Failing after 3s
Build and Test / test-bypass-proxy (push) Failing after 34s
Build and Test / test-git-container (push) Failing after 36s
Build and Test / test (macos-latest) (push) Has been cancelled
Build and Test / test (windows-latest) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Failing after 3s
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 5.3.0 to 6.5.0. - [Release notes](https://github.com/docker/build-push-action/releases) - [Commits](https://github.com/docker/build-push-action/compare/v5.3.0...v6.5.0) --- updated-dependencies: - dependency-name: docker/build-push-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
60 lines
2.2 KiB
YAML
60 lines
2.2 KiB
YAML
name: Publish test-ubuntu-git Container
|
|
|
|
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? (main branch only)'
|
|
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/login-action@v3.3.0
|
|
with:
|
|
registry: ${{ env.REGISTRY }}
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Format Timestamp
|
|
id: timestamp
|
|
# Use `date` with a custom format to achieve the key=value format GITHUB_OUTPUT expects.
|
|
run: date -u "+now=%Y%m%d.%H%M%S.%3NZ" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Issue Image Publish Warning
|
|
if: ${{ inputs.publish && github.ref_name != 'main' }}
|
|
run: echo "::warning::test-ubuntu-git images can only be published from the actions/checkout 'main' branch. Workflow will continue with push/publish disabled."
|
|
|
|
# Use `docker/build-push-action` to build (and optionally publish) the image.
|
|
- name: Build Docker Image (with optional Push)
|
|
uses: docker/build-push-action@v6.5.0
|
|
with:
|
|
context: .
|
|
file: images/test-ubuntu-git.Dockerfile
|
|
# For now, attempts to push to ghcr.io must target the `main` branch.
|
|
# In the future, consider also allowing attempts from `releases/*` branches.
|
|
push: ${{ inputs.publish && github.ref_name == 'main' }}
|
|
tags: |
|
|
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}.${{ steps.timestamp.outputs.now }}
|