Skip to content

Commit

Permalink
add /
Browse files Browse the repository at this point in the history
  • Loading branch information
iamjooon2 committed Sep 13, 2024
1 parent f3e4a29 commit 6c83fd2
Showing 1 changed file with 22 additions and 10 deletions.
32 changes: 22 additions & 10 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,37 @@ jobs:
with:
go-version: 1.22.5

- name: add dependencies
- name : add dependency
run : |
go mod init techbloghub
- name: build go file
run: |
go mod tidy
go build -v ./...
- name: Build Docker image
run: |
docker build --tag techbloghub .
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{secrets.DOCKER_HUB_USERNAME}}
password: ${{secrets.DOCKER_HUB_TOKEN}}

- name: build and release to DockerHub
env:
NAME: ${{secrets.DOCKER_HUB_USERNAME}}
REPO: ${{secrets.DOCKER_HUB_REPO}}
run: |
go mod init techbloghub
docker build . -t techbloghub
docker run -p 3000:3000 techbloghub
# Docker Build & Push
- name: Docker Build and push
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
platforms: linux/amd64
push: true
tags: |
${{ secrets.DOCKER_HUB_USERNAME }}/server:${{github.run_number}}
${{ secrets.DOCKER_HUB_USERNAME }}/server:latest
cache-from: type=gha
cache-to: type=gha,mode=max

0 comments on commit 6c83fd2

Please sign in to comment.