From 303d8cdd4525e35f275df4199aa152944351ac72 Mon Sep 17 00:00:00 2001 From: Colin Griffin Date: Fri, 17 Dec 2021 10:46:58 -0500 Subject: [PATCH 1/6] commit initial docker build/push workflow --- .../workflows/docker-build-push-dockerhub.yml | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/docker-build-push-dockerhub.yml diff --git a/.github/workflows/docker-build-push-dockerhub.yml b/.github/workflows/docker-build-push-dockerhub.yml new file mode 100644 index 0000000..2e79a17 --- /dev/null +++ b/.github/workflows/docker-build-push-dockerhub.yml @@ -0,0 +1,56 @@ +# This is a basic workflow to help you get started with Actions + +name: Build and push image to GitHub container registry + +# Controls when the workflow will run +on: push +# on: + # release: + # types: [ created ] + + # # Allows you to run this workflow manually from the Actions tab + # workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + + - name: Docker Login + # You may pin to the exact commit or the version. + # uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 + uses: docker/login-action@v1.10.0 + with: + # Username used to log against the Docker registry + username: ${{ secrets.DOCKER_HUB_USERNAME }} + # Password or personal access token used to log against the Docker registry + password: ${{ secrets.DOCKER_HUB_TOKEN }} + # Log out from the Docker registry at the end of a job + logout: true # optional, default is true + + - name: Set up Docker builder + id: buildx + uses: docker/setup-buildx-action@v1.6.0 + + - name: Build and push image + id: docker_build + uses: docker/build-push-action@v2 + with: + context: ./ + file: ./Dockerfile + push: true + # The test image is /docker and is private. final image will be /calendso and public + tags: docker.io/${{ secrets.DOCKER_HUB_USERNAME }}/docker:latest + build-args: | + BASE_URL=http://localhost:3000 + NEXT_PUBLIC_APP_URL=http://localhost:3000 + + - name: Image digest + run: echo ${{ steps.docker_build.outputs.digest }} From a3dabf374822237909a72ad152832b38e9f6e4be Mon Sep 17 00:00:00 2001 From: Colin Griffin Date: Fri, 17 Dec 2021 10:50:16 -0500 Subject: [PATCH 2/6] specify submodules: true --- .github/workflows/docker-build-push-dockerhub.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/docker-build-push-dockerhub.yml b/.github/workflows/docker-build-push-dockerhub.yml index 2e79a17..0b2c373 100644 --- a/.github/workflows/docker-build-push-dockerhub.yml +++ b/.github/workflows/docker-build-push-dockerhub.yml @@ -22,6 +22,8 @@ jobs: steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v2 + with: + submodules: true - name: Docker Login # You may pin to the exact commit or the version. From 329d7deb4cd23b967d035d1863969c5c76d6cc49 Mon Sep 17 00:00:00 2001 From: Colin Griffin Date: Fri, 17 Dec 2021 12:13:34 -0500 Subject: [PATCH 3/6] update registry name --- .github/workflows/docker-build-push-dockerhub.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-build-push-dockerhub.yml b/.github/workflows/docker-build-push-dockerhub.yml index 0b2c373..3978b58 100644 --- a/.github/workflows/docker-build-push-dockerhub.yml +++ b/.github/workflows/docker-build-push-dockerhub.yml @@ -1,9 +1,11 @@ # This is a basic workflow to help you get started with Actions -name: Build and push image to GitHub container registry +name: Build and push image to DockerHub # Controls when the workflow will run on: push + +# Leaving in example for releases. Initially we simply push to 'latest' # on: # release: # types: [ created ] @@ -49,7 +51,7 @@ jobs: file: ./Dockerfile push: true # The test image is /docker and is private. final image will be /calendso and public - tags: docker.io/${{ secrets.DOCKER_HUB_USERNAME }}/docker:latest + tags: docker.io/${{ secrets.DOCKER_HUB_USERNAME }}/calendso:latest build-args: | BASE_URL=http://localhost:3000 NEXT_PUBLIC_APP_URL=http://localhost:3000 From bc9ef1619eff51578b1485d702c0caa337d49c3c Mon Sep 17 00:00:00 2001 From: Colin Griffin Date: Fri, 17 Dec 2021 12:14:46 -0500 Subject: [PATCH 4/6] update image paths --- docker-compose.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index c023705..f50c221 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -25,7 +25,7 @@ services: args: - BASE_URL=${BASE_URL} - NEXT_PUBLIC_APP_URL=${NEXT_PUBLIC_APP_URL} - image: calendso/docker + image: calendso/calendso:latest restart: always networks: - stack @@ -39,7 +39,7 @@ services: # Optional use of Prisma Studio. In production, comment out or remove the section below to prevent unwanted access to your database. studio: - image: calendso/docker + image: calendso/calendso:latest restart: always networks: - stack From d99a625c6a87db7cd1eca77de021cafabacfe953 Mon Sep 17 00:00:00 2001 From: Colin Griffin Date: Fri, 17 Dec 2021 12:32:13 -0500 Subject: [PATCH 5/6] add dockerhub location --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index fd5e5bb..a8a10c6 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,8 @@ # calendso-docker +This image can be found on DockerHub at [https://hub.docker.com/repository/docker/calendso/calendso](https://hub.docker.com/repository/docker/calendso/calendso) + The Docker configuration for Calendso is an effort powered by people within the community. Calendso does not provide official support for Docker, but we will accept fixes and documentation. Use at your own risk. ## Requirements From 03a6d0af3ace4951c82efa6316785ccaa5fd5a4e Mon Sep 17 00:00:00 2001 From: Colin Griffin Date: Fri, 17 Dec 2021 12:33:49 -0500 Subject: [PATCH 6/6] trigger on branch main only --- .github/workflows/docker-build-push-dockerhub.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-build-push-dockerhub.yml b/.github/workflows/docker-build-push-dockerhub.yml index 3978b58..684c5e4 100644 --- a/.github/workflows/docker-build-push-dockerhub.yml +++ b/.github/workflows/docker-build-push-dockerhub.yml @@ -3,7 +3,10 @@ name: Build and push image to DockerHub # Controls when the workflow will run -on: push +on: + push: + branches: + - main # Leaving in example for releases. Initially we simply push to 'latest' # on: