From 7c7594322f4ddd3cf5efd0f4de5ac0f60995f186 Mon Sep 17 00:00:00 2001 From: Dave McKay Date: Mon, 24 Jun 2024 16:23:59 +0100 Subject: [PATCH 1/7] Create docker-image.yml --- .github/workflows/docker-image.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/docker-image.yml diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 0000000..3f53646 --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,18 @@ +name: Docker Image CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Build the Docker image + run: docker build . --file Dockerfile --tag my-image-name:$(date +%s) From 7b9c15f0528683bf5e7ebaae71394dfe828a105b Mon Sep 17 00:00:00 2001 From: Dave McKay Date: Mon, 24 Jun 2024 16:28:49 +0100 Subject: [PATCH 2/7] docker build action --- .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 3f53646..ad9fdd5 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -15,4 +15,4 @@ jobs: steps: - uses: actions/checkout@v4 - name: Build the Docker image - run: docker build . --file Dockerfile --tag my-image-name:$(date +%s) + run: docker build . --file echo-side/containers/basic_env/Dockerfile --tag csd3-echo-somerville:$(date +%s) --tag csd3-echo-somerville:latest From fc8b390ba877d9a9302009a87165367392d7fc06 Mon Sep 17 00:00:00 2001 From: Dave McKay Date: Mon, 24 Jun 2024 16:29:42 +0100 Subject: [PATCH 3/7] . --- .github/workflows/docker-image.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index ad9fdd5..a9caaff 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -2,9 +2,9 @@ name: Docker Image CI on: push: - branches: [ "main" ] + branches: [ "build_container_action" ] pull_request: - branches: [ "main" ] + branches: [ "build_container_action" ] jobs: @@ -15,4 +15,4 @@ jobs: steps: - uses: actions/checkout@v4 - name: Build the Docker image - run: docker build . --file echo-side/containers/basic_env/Dockerfile --tag csd3-echo-somerville:$(date +%s) --tag csd3-echo-somerville:latest + run: docker build . --file echo-side/containers/basic_env/Dockerfile --tag ghcr.io/lsst-uk/csd3-echo-somerville:$(date +%s) --tag ghcr.io/lsst-uk/csd3-echo-somerville:latest From 2841f894a31794db138445f43b4b001426592cd8 Mon Sep 17 00:00:00 2001 From: Dave McKay Date: Mon, 24 Jun 2024 16:35:15 +0100 Subject: [PATCH 4/7] docker push --- .github/workflows/docker-image.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index a9caaff..665bf89 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -16,3 +16,5 @@ jobs: - uses: actions/checkout@v4 - name: Build the Docker image run: docker build . --file echo-side/containers/basic_env/Dockerfile --tag ghcr.io/lsst-uk/csd3-echo-somerville:$(date +%s) --tag ghcr.io/lsst-uk/csd3-echo-somerville:latest + - name: Push the Docker image + run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u davedavemckay --password-stdin && docker push ghcr.io/lsst-uk/csd3-echo-somerville:$(date +%s) && docker push ghcr.io/lsst-uk/csd3-echo-somerville:latest From 09f4a77d1fdf1dfe7cace4edf4bae5dd860ce7e4 Mon Sep 17 00:00:00 2001 From: Dave McKay Date: Mon, 24 Jun 2024 16:39:55 +0100 Subject: [PATCH 5/7] using ymd for tag --- .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 665bf89..6f489e6 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -15,6 +15,6 @@ jobs: steps: - uses: actions/checkout@v4 - name: Build the Docker image - run: docker build . --file echo-side/containers/basic_env/Dockerfile --tag ghcr.io/lsst-uk/csd3-echo-somerville:$(date +%s) --tag ghcr.io/lsst-uk/csd3-echo-somerville:latest + run: docker build . --file echo-side/containers/basic_env/Dockerfile --tag ghcr.io/lsst-uk/csd3-echo-somerville:$(date +%Y%m%d) --tag ghcr.io/lsst-uk/csd3-echo-somerville:latest - name: Push the Docker image - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u davedavemckay --password-stdin && docker push ghcr.io/lsst-uk/csd3-echo-somerville:$(date +%s) && docker push ghcr.io/lsst-uk/csd3-echo-somerville:latest + run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u davedavemckay --password-stdin && docker push ghcr.io/lsst-uk/csd3-echo-somerville:$(date +%Y%m%d) && docker push ghcr.io/lsst-uk/csd3-echo-somerville:latest From e87baab560a9ff642e2f60603012118142429cc5 Mon Sep 17 00:00:00 2001 From: Dave McKay Date: Mon, 24 Jun 2024 16:48:36 +0100 Subject: [PATCH 6/7] user --- .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 6f489e6..6bcd20d 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -17,4 +17,4 @@ jobs: - name: Build the Docker image run: docker build . --file echo-side/containers/basic_env/Dockerfile --tag ghcr.io/lsst-uk/csd3-echo-somerville:$(date +%Y%m%d) --tag ghcr.io/lsst-uk/csd3-echo-somerville:latest - name: Push the Docker image - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u davedavemckay --password-stdin && docker push ghcr.io/lsst-uk/csd3-echo-somerville:$(date +%Y%m%d) && docker push ghcr.io/lsst-uk/csd3-echo-somerville:latest + run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u lsst-uk --password-stdin && docker push ghcr.io/lsst-uk/csd3-echo-somerville:$(date +%Y%m%d) && docker push ghcr.io/lsst-uk/csd3-echo-somerville:latest From 7cf17cec90f0ff583aea2083fb321c40d49a9b86 Mon Sep 17 00:00:00 2001 From: Dave McKay Date: Mon, 24 Jun 2024 17:01:48 +0100 Subject: [PATCH 7/7] done --- .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 6bcd20d..421315d 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -2,9 +2,9 @@ name: Docker Image CI on: push: - branches: [ "build_container_action" ] + branches: [ "main" ] pull_request: - branches: [ "build_container_action" ] + branches: [ "main" ] jobs: