Skip to content

Commit

Permalink
docker
Browse files Browse the repository at this point in the history
  • Loading branch information
Pamparampam committed Feb 23, 2025
1 parent 1f8685d commit 8788ff6
Showing 1 changed file with 19 additions and 25 deletions.
44 changes: 19 additions & 25 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,42 +12,36 @@ jobs:
packages: write

steps:
# 1. Checkout the repository
# 1️⃣ Checkout the repository
- name: Checkout repository
uses: actions/checkout@v4

# 2. Set up Docker
# 2️⃣ Set up Docker Buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

# 3. Log in to Docker Hub
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

# 5. Logs to GitHub Container Registry
# 3️⃣ Log in to GitHub Container Registry
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.MY_GITHUB_TOKEN }} # GitHub Token for authentication
password: ${{ secrets.MY_GITHUB_TOKEN }}

# 6. Build and push the Docker images using docker-compose
- name: Build and push Docker images
# 4️⃣ Build & push Backend image (Multi-Platform)
- name: Build & Push Backend Image
run: |
apt-get update && apt-get install -y --no-install-recommends build-essential
docker compose build
# 7. Tag and push Backend to GitHub Container Registry
- name: Tag and push Backend to GitHub Container Registry
run: |
docker images -a
docker push ghcr.io/${{ github.repository_owner }}/idrive-backend:latest
# 8. Tag and push Nginx to GitHub Container Registry
- name: Tag and push Nginx to GitHub Container Registry
docker buildx build \
--platform linux/amd64,linux/arm64 \
--push \
-t ghcr.io/${{ github.repository_owner }}/idrive-backend:latest \
./backend
# 5️⃣ Build & push Nginx image (Multi-Platform)
- name: Build & Push Nginx Image
run: |
docker push ghcr.io/${{ github.repository_owner }}/idrive-nginx:latest
docker buildx build \
--platform linux/amd64,linux/arm64 \
--push \
-t ghcr.io/${{ github.repository_owner }}/idrive-nginx:latest \
./frontend

0 comments on commit 8788ff6

Please sign in to comment.