Skip to content

Commit

Permalink
test docker hub
Browse files Browse the repository at this point in the history
  • Loading branch information
lamminhthien committed Jun 14, 2024
1 parent 71f7065 commit 2f17eae
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 15 deletions.
41 changes: 27 additions & 14 deletions .github/workflows/build_api.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,34 @@
name: Build Docker Image for API
name: Build API and push to DockerHub

on:
push:
paths:
- 'apps/api/**'
pull_request:
paths:
- 'apps/api/**'
branches:
- 'main'

jobs:
build:
docker:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Build Docker image
run: |
docker build -f ./apps/api/Dockerfile .
-
name: Checkout
uses: actions/checkout@v4
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
file: ./apps/api/Dockerfile
tags: lamminhthien02012000604/api-mono-repo-thienlam:latest
2 changes: 1 addition & 1 deletion apps/api/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ const port = process.env.PORT || 3001;
const server = createServer();

server.listen(port, () => {
log(`api running on 9 ${port}`);
log(`api running on 10 ${port}`);
});

0 comments on commit 2f17eae

Please sign in to comment.