Add Docker Image CI workflow#44043
Add Docker Image CI workflow#44043marekdkropiewnicki-dotcom wants to merge 1 commit intogithub:mainfrom
Conversation
|
👋 Hey there spelunker. It looks like you've modified some files that we can't accept as contributions:
You'll need to revert all of the files you changed that match that list using GitHub Desktop or The complete list of files we can't accept are:
We also can't accept contributions to files in the content directory with frontmatter |
How to review these changes 👓Thank you for your contribution. To review these changes, choose one of the following options: A Hubber will need to deploy your changes internally to review. Table of review linksNote: Please update the URL for your staging server or codespace. This pull request contains code changes, so we will not generate a table of review links. 🤖 This comment is automatically generated. |
There was a problem hiding this comment.
Pull request overview
Adds a new GitHub Actions workflow intended to build the repository’s Docker image on pushes and pull requests targeting main.
Changes:
- Introduces
.github/workflows/docker-image.ymlto rundocker buildin CI. - Checks out the repository and builds the root
Dockerfileimage.
| - uses: actions/checkout@v4 | ||
| - name: Build the Docker image | ||
| run: docker build . --file Dockerfile --tag my-image-name:$(date +%s) |
There was a problem hiding this comment.
steps: is incorrectly indented: the list items (- uses, - name) need to be indented under steps:. As written, this workflow will fail YAML parsing / the steps key will not contain the step list, so the job won’t run.
| - uses: actions/checkout@v4 | |
| - name: Build the Docker image | |
| run: docker build . --file Dockerfile --tag my-image-name:$(date +%s) | |
| - uses: actions/checkout@v4 | |
| - name: Build the Docker image | |
| run: docker build . --file Dockerfile --tag my-image-name:$(date +%s) |
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 |
There was a problem hiding this comment.
This workflow uses actions/checkout@v4, but this repo’s workflows generally pin actions/checkout to a specific commit SHA (e.g. 8e8c483... # v6.0.1) to reduce supply-chain risk. Please update to the pinned SHA/version used elsewhere in .github/workflows/.
| - uses: actions/checkout@v4 | |
| - uses: actions/checkout@8e8c483e0f71c1f5f6bbf3c5c8ec0e5c0eb0f3f8 # v6.0.1 |
|
|
||
| jobs: | ||
|
|
||
| build: |
There was a problem hiding this comment.
For consistency with other workflows in this repo and to reduce risk/noise, add an explicit minimal permissions: block (e.g. contents: read) and gate the job with if: github.repository == 'github/docs-internal' || github.repository == 'github/docs' so forks don’t run this workflow by default.
| jobs: | |
| build: | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| if: github.repository == 'github/docs-internal' || github.repository == 'github/docs' |
Why:
Closes:
What's being changed (if available, include any code snippets, screenshots, or gifs):
Check off the following: