Skip to content

Add Docker support with build and push workflow#28

Merged
Brunowar12 merged 3 commits into
masterfrom
docker-cd
May 25, 2025
Merged

Add Docker support with build and push workflow#28
Brunowar12 merged 3 commits into
masterfrom
docker-cd

Conversation

@Brunowar12
Copy link
Copy Markdown
Owner

No description provided.

+ dockerignore
+ docker-compose
+ Dockerfile
+ new workflow for docker build
Comment on lines +10 to +30
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: rubonrwra12/taskmanagersystem:latest

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 12 months ago

To fix the issue, we will add a permissions block at the root of the workflow file. This block will specify the minimal permissions required for the workflow to function. Based on the workflow's steps, it primarily interacts with the repository contents (e.g., checking out the repository) and Docker Hub. Therefore, the contents: read permission is sufficient. No write permissions are required for this workflow.


Suggested changeset 1
.github/workflows/docker-build.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml
--- a/.github/workflows/docker-build.yml
+++ b/.github/workflows/docker-build.yml
@@ -7,2 +7,5 @@
 
+permissions:
+  contents: read
+
 jobs:
EOF
@@ -7,2 +7,5 @@

permissions:
contents: read

jobs:
Copilot is powered by AI and may make mistakes. Always verify output.
@Brunowar12 Brunowar12 merged commit e2731c6 into master May 25, 2025
6 checks passed
@Brunowar12 Brunowar12 deleted the docker-cd branch May 25, 2025 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants