From b39316219c58796abe63302986be4ab1261debda Mon Sep 17 00:00:00 2001 From: tamsaleh Date: Mon, 7 Oct 2024 12:05:28 -0300 Subject: [PATCH 1/4] ADD: dockerfile and pipeline --- .github/workflows/docker-image.yml | 32 ++++++++++++++++++++++++++++++ Dockerfile | 7 +++++++ 2 files changed, 39 insertions(+) create mode 100644 .github/workflows/docker-image.yml create mode 100644 Dockerfile diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 000000000..38fdc5450 --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,32 @@ +name: Docker Image CI +on: + push: + branches: + - main + pull_request: + branches: + -main + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Log in to Github Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{github.repository_owner}} + password: ${{secrets.GITHUB_TOKEN}} + - name: Build and push Dock image + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: | + ghcr.io/${{github.repository_owner}}/getting-started: latest + ghcr.io/${{github.repository_owner}}/getting-started: ${{github.sha}} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..6baf3f37f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,7 @@ +FROM node:18-alpine +WORKDIR /app +COPY . . +RUN yarn install --production && yarn cache clean +ENTRYPOINT ["node"] +CMD ["src/index.js"] +EXPOSE 3000 From 035d9b9fcb0389fa7181a88ab0cccad4a9e4fbeb Mon Sep 17 00:00:00 2001 From: tamsaleh Date: Mon, 7 Oct 2024 12:09:17 -0300 Subject: [PATCH 2/4] FIX: fixed typo in docker image --- .github/workflows/docker-image.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 38fdc5450..85c1357ed 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -28,5 +28,5 @@ jobs: context: . push: true tags: | - ghcr.io/${{github.repository_owner}}/getting-started: latest - ghcr.io/${{github.repository_owner}}/getting-started: ${{github.sha}} \ No newline at end of file + ghcr.io/${{github.repository_owner}}/getting-started-app: latest + ghcr.io/${{github.repository_owner}}/getting-started-app: ${{github.sha}} \ No newline at end of file From f3d9f7def5ee989e62e58a3770b375d704179b94 Mon Sep 17 00:00:00 2001 From: tamsaleh Date: Mon, 7 Oct 2024 12:13:34 -0300 Subject: [PATCH 3/4] FIX: fixed typo in docker image --- .github/workflows/docker-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 85c1357ed..9e049f595 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -28,5 +28,5 @@ jobs: context: . push: true tags: | - ghcr.io/${{github.repository_owner}}/getting-started-app: latest + ghcr.io/${{github.repository_owner}}/getting-started-app: v1 ghcr.io/${{github.repository_owner}}/getting-started-app: ${{github.sha}} \ No newline at end of file From 8e45b38b59e0de2210e9d628811e3c13ff2db8dc Mon Sep 17 00:00:00 2001 From: tamsaleh Date: Mon, 7 Oct 2024 12:18:26 -0300 Subject: [PATCH 4/4] FIX: fixed typo in docker image --- .github/workflows/docker-image.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 9e049f595..056a3441e 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -28,5 +28,5 @@ jobs: context: . push: true tags: | - ghcr.io/${{github.repository_owner}}/getting-started-app: v1 - ghcr.io/${{github.repository_owner}}/getting-started-app: ${{github.sha}} \ No newline at end of file + ghcr.io/${{github.repository_owner}}/getting-started-app:latest + ghcr.io/${{github.repository_owner}}/getting-started-app:${{github.sha}} \ No newline at end of file