-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build images online #7
base: master
Are you sure you want to change the base?
Changes from 10 commits
b756407
8a6e30e
10a1c12
3996a4f
25ada83
0d7a560
cad00e0
3ba70bd
9e3bf2f
f37ed4e
6cf237d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,49 @@ | ||
name: docker image build | ||
name: Build and Push Docker Image to GHCR | ||
|
||
on: | ||
push: | ||
branches: [ "**" ] | ||
|
||
branches: | ||
- main # 你可以根据需要更改为你的主分支 | ||
- master | ||
tags: | ||
- '*' | ||
pull_request: | ||
branches: | ||
- main # 你可以根据需要更改为你的主分支x | ||
- master | ||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
|
||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Build the Docker image | ||
run: docker build . --file Dockerfile --tag my-image-name:$(date +%s) | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract Docker metadata | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ echo 'ros_dev() { | |
shift 2 | ||
|
||
# Run docker-compose from the correct directory | ||
cd "$SCRIPT_DIR" && docker-compose up -d --build | ||
cd "$SCRIPT_DIR" && docker-compose up -d | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification Reinstate the The removal of the Recommended Actions:
🔗 Analysis chainReconsider removing the The removal of the
Consider the following options:
To understand the impact of this change, let's check if there are any Dockerfiles or docker-compose.yml files in the repository: This will help us understand the Docker setup and potential implications of not rebuilding images. 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Check for Dockerfile and docker-compose.yml
echo "Searching for Dockerfile:"
fd Dockerfile
echo "Searching for docker-compose.yml:"
fd docker-compose.yml
Length of output: 207 |
||
done | ||
} | ||
' >> "$HOME/.bashrc" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update checkout action to the latest version.
While using a specific version is good for stability, the current version (v2) of the
actions/checkout
action is outdated.Update to the latest version to ensure you have the most recent features and bug fixes:
This will resolve the warning from the static analysis tool and potentially provide performance improvements.
📝 Committable suggestion
🧰 Tools
🪛 actionlint