From 4f2e83b046bc76be7337bcafa65367827eb99613 Mon Sep 17 00:00:00 2001 From: Richmond Date: Tue, 13 Aug 2024 08:23:00 +0800 Subject: [PATCH 01/22] poc-github-packages --- .github/workflows/deploy-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-image.yml b/.github/workflows/deploy-image.yml index fb73d39..0e958de 100644 --- a/.github/workflows/deploy-image.yml +++ b/.github/workflows/deploy-image.yml @@ -4,7 +4,7 @@ on: push env: REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} + IMAGE_NAME: poc-installed-packages jobs: build-and-push-image: From ee7f87f1d1076663bb18ba2b711baecf1828b910 Mon Sep 17 00:00:00 2001 From: Richmond Date: Tue, 13 Aug 2024 08:25:20 +0800 Subject: [PATCH 02/22] chore: Update deploy-image.yml to use the repository name as the image name --- .github/workflows/deploy-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-image.yml b/.github/workflows/deploy-image.yml index 0e958de..fb73d39 100644 --- a/.github/workflows/deploy-image.yml +++ b/.github/workflows/deploy-image.yml @@ -4,7 +4,7 @@ on: push env: REGISTRY: ghcr.io - IMAGE_NAME: poc-installed-packages + IMAGE_NAME: ${{ github.repository }} jobs: build-and-push-image: From 03184e41a7ec70d152d26111321ede8dfe14c40b Mon Sep 17 00:00:00 2001 From: Richmond Date: Tue, 13 Aug 2024 08:32:14 +0800 Subject: [PATCH 03/22] chore: Update Dockerfile to echo "Hello World Altus" --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 44279b7..93d37c2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,2 +1,2 @@ FROM alpine -CMD [ "echo", "Hello World" ] \ No newline at end of file +CMD [ "echo", "Hello World Altus" ] \ No newline at end of file From f3e70d2b9e12a7190a567e70fff5e2878cb36a95 Mon Sep 17 00:00:00 2001 From: Richmond Date: Tue, 13 Aug 2024 08:55:22 +0800 Subject: [PATCH 04/22] chore: Update deploy-image.yml to use a specific image name --- .github/workflows/deploy-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-image.yml b/.github/workflows/deploy-image.yml index fb73d39..0e958de 100644 --- a/.github/workflows/deploy-image.yml +++ b/.github/workflows/deploy-image.yml @@ -4,7 +4,7 @@ on: push env: REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} + IMAGE_NAME: poc-installed-packages jobs: build-and-push-image: From d5190f7dd79d16f99870a06c723272c22df805a4 Mon Sep 17 00:00:00 2001 From: Richmond Date: Tue, 13 Aug 2024 09:01:11 +0800 Subject: [PATCH 05/22] chore: Update deploy-image.yml to use a custom image name with branch name --- .github/workflows/deploy-image.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-image.yml b/.github/workflows/deploy-image.yml index 0e958de..530debd 100644 --- a/.github/workflows/deploy-image.yml +++ b/.github/workflows/deploy-image.yml @@ -4,7 +4,8 @@ on: push env: REGISTRY: ghcr.io - IMAGE_NAME: poc-installed-packages + CUSTOM_NAME: poc-installed-packages + IMAGE_NAME: ${{ env.CUSTOM_NAME }}-${{ github.ref_name }} # Use the branch name in combination with your custom name jobs: build-and-push-image: From f170c75e58ae2e1b287a5ab91b62e1cf444346a5 Mon Sep 17 00:00:00 2001 From: Richmond Date: Tue, 13 Aug 2024 09:01:51 +0800 Subject: [PATCH 06/22] chore: Update deploy-image.yml to use consistent image naming --- .github/workflows/deploy-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-image.yml b/.github/workflows/deploy-image.yml index 530debd..87ae367 100644 --- a/.github/workflows/deploy-image.yml +++ b/.github/workflows/deploy-image.yml @@ -5,7 +5,7 @@ on: push env: REGISTRY: ghcr.io CUSTOM_NAME: poc-installed-packages - IMAGE_NAME: ${{ env.CUSTOM_NAME }}-${{ github.ref_name }} # Use the branch name in combination with your custom name + IMAGE_NAME: ${{ env.CUSTOM_NAME }}-${{ github.ref_name }} jobs: build-and-push-image: From 300fbca7220417f178aee359cd7eb26bac9b669e Mon Sep 17 00:00:00 2001 From: Richmond Date: Tue, 13 Aug 2024 09:02:43 +0800 Subject: [PATCH 07/22] chore: Update deploy-image.yml to use consistent image naming --- .github/workflows/deploy-image.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/deploy-image.yml b/.github/workflows/deploy-image.yml index 87ae367..bb56172 100644 --- a/.github/workflows/deploy-image.yml +++ b/.github/workflows/deploy-image.yml @@ -4,8 +4,7 @@ on: push env: REGISTRY: ghcr.io - CUSTOM_NAME: poc-installed-packages - IMAGE_NAME: ${{ env.CUSTOM_NAME }}-${{ github.ref_name }} + IMAGE_NAME: ${{ github.ref_name }} jobs: build-and-push-image: From e3449185ae4b07be05289075fb7e16f9ad166b57 Mon Sep 17 00:00:00 2001 From: Richmond Date: Tue, 13 Aug 2024 09:06:22 +0800 Subject: [PATCH 08/22] chore: Update deploy-image.yml to use repository name as the image name --- .github/workflows/deploy-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-image.yml b/.github/workflows/deploy-image.yml index bb56172..fb73d39 100644 --- a/.github/workflows/deploy-image.yml +++ b/.github/workflows/deploy-image.yml @@ -4,7 +4,7 @@ on: push env: REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.ref_name }} + IMAGE_NAME: ${{ github.repository }} jobs: build-and-push-image: From b89038106e21c6c37fca9ff5bcde5564ae2c2e99 Mon Sep 17 00:00:00 2001 From: Richmond Date: Tue, 13 Aug 2024 09:12:01 +0800 Subject: [PATCH 09/22] chore: Update deploy-image.yml to use a custom image name with branch name --- .github/workflows/deploy-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-image.yml b/.github/workflows/deploy-image.yml index fb73d39..d2bdc64 100644 --- a/.github/workflows/deploy-image.yml +++ b/.github/workflows/deploy-image.yml @@ -4,7 +4,7 @@ on: push env: REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} + IMAGE_NAME: image-installed-packages jobs: build-and-push-image: From 39ef390241d658e33c5e46d7ccc9066c9b009c1e Mon Sep 17 00:00:00 2001 From: Richmond Date: Tue, 13 Aug 2024 09:16:25 +0800 Subject: [PATCH 10/22] chore: Update deploy-image.yml to use consistent image naming --- .github/workflows/deploy-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-image.yml b/.github/workflows/deploy-image.yml index d2bdc64..71a49b8 100644 --- a/.github/workflows/deploy-image.yml +++ b/.github/workflows/deploy-image.yml @@ -4,7 +4,7 @@ on: push env: REGISTRY: ghcr.io - IMAGE_NAME: image-installed-packages + IMAGE_NAME: installed-packages jobs: build-and-push-image: From e9d14704d01b28de47ec519b1dbe93c6e700d636 Mon Sep 17 00:00:00 2001 From: Richmond Date: Tue, 13 Aug 2024 09:27:14 +0800 Subject: [PATCH 11/22] chore: Update deploy-image.yml to use consistent image naming --- .github/workflows/deploy-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-image.yml b/.github/workflows/deploy-image.yml index 71a49b8..fb73d39 100644 --- a/.github/workflows/deploy-image.yml +++ b/.github/workflows/deploy-image.yml @@ -4,7 +4,7 @@ on: push env: REGISTRY: ghcr.io - IMAGE_NAME: installed-packages + IMAGE_NAME: ${{ github.repository }} jobs: build-and-push-image: From ac262511947f257cf4b7af5b6389fc4b7d82e0f7 Mon Sep 17 00:00:00 2001 From: Richmond Date: Tue, 13 Aug 2024 10:59:08 +0800 Subject: [PATCH 12/22] chore: Update deploy-image.yml to use consistent image naming --- .github/workflows/deploy-image.yml | 11 ++++++++++- Dockerfile | 2 +- client/Dockerfile | 2 ++ 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 client/Dockerfile diff --git a/.github/workflows/deploy-image.yml b/.github/workflows/deploy-image.yml index fb73d39..8416a21 100644 --- a/.github/workflows/deploy-image.yml +++ b/.github/workflows/deploy-image.yml @@ -9,6 +9,14 @@ env: jobs: build-and-push-image: runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - dockerfile: ./client/Dockerfile + image: ghcr.io/username/image1 + - dockerfile: ./server/Dockerfile + image: ghcr.io/username/image2 permissions: contents: read packages: write @@ -28,7 +36,7 @@ jobs: id: meta uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + images: ${{ matrix.image }} tags: | type=ref,event=branch type=sha @@ -37,6 +45,7 @@ jobs: uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc with: context: . + file: ${{ matrix.dockerfile }} push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 93d37c2..5065dc9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,2 +1,2 @@ FROM alpine -CMD [ "echo", "Hello World Altus" ] \ No newline at end of file +CMD [ "echo", "Hello World Altus Server" ] \ No newline at end of file diff --git a/client/Dockerfile b/client/Dockerfile new file mode 100644 index 0000000..b4d1c10 --- /dev/null +++ b/client/Dockerfile @@ -0,0 +1,2 @@ +FROM alpine +CMD [ "echo", "Hello World Altus Client" ] \ No newline at end of file From bd1695d579311dafbe49191cef3b1fd474af4163 Mon Sep 17 00:00:00 2001 From: Richmond Date: Tue, 13 Aug 2024 11:05:05 +0800 Subject: [PATCH 13/22] chore: Update deploy-image.yml to use consistent image naming --- .github/workflows/deploy-image.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-image.yml b/.github/workflows/deploy-image.yml index 8416a21..5fa64bd 100644 --- a/.github/workflows/deploy-image.yml +++ b/.github/workflows/deploy-image.yml @@ -13,9 +13,9 @@ jobs: fail-fast: false matrix: include: - - dockerfile: ./client/Dockerfile + - dockerfile: ../../client/Dockerfile image: ghcr.io/username/image1 - - dockerfile: ./server/Dockerfile + - dockerfile: ../../server/Dockerfile image: ghcr.io/username/image2 permissions: contents: read From bf89ad0bd1782bbde2e99fe033eae42d66a773fd Mon Sep 17 00:00:00 2001 From: Richmond Date: Tue, 13 Aug 2024 11:06:57 +0800 Subject: [PATCH 14/22] chore: move docker file --- Dockerfile => server/Dockerfile | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Dockerfile => server/Dockerfile (100%) diff --git a/Dockerfile b/server/Dockerfile similarity index 100% rename from Dockerfile rename to server/Dockerfile From ef9167b47c7731d183b77cbd324b90823cecd9e8 Mon Sep 17 00:00:00 2001 From: Richmond Date: Tue, 13 Aug 2024 11:08:47 +0800 Subject: [PATCH 15/22] chore: Update deploy-image.yml to use relative paths for Dockerfiles --- .github/workflows/deploy-image.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-image.yml b/.github/workflows/deploy-image.yml index 5fa64bd..d86cd3e 100644 --- a/.github/workflows/deploy-image.yml +++ b/.github/workflows/deploy-image.yml @@ -13,9 +13,9 @@ jobs: fail-fast: false matrix: include: - - dockerfile: ../../client/Dockerfile + - dockerfile: ./../client/Dockerfile image: ghcr.io/username/image1 - - dockerfile: ../../server/Dockerfile + - dockerfile: ./../server/Dockerfile image: ghcr.io/username/image2 permissions: contents: read From 039e20ff201bc8c1c89db8b1774270adcd347bfb Mon Sep 17 00:00:00 2001 From: Richmond Date: Tue, 13 Aug 2024 11:09:34 +0800 Subject: [PATCH 16/22] chore: Update deploy-image.yml to use consistent image naming --- .github/workflows/deploy-image.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-image.yml b/.github/workflows/deploy-image.yml index d86cd3e..bc16502 100644 --- a/.github/workflows/deploy-image.yml +++ b/.github/workflows/deploy-image.yml @@ -13,9 +13,9 @@ jobs: fail-fast: false matrix: include: - - dockerfile: ./../client/Dockerfile + - dockerfile: ././client/Dockerfile image: ghcr.io/username/image1 - - dockerfile: ./../server/Dockerfile + - dockerfile: ././server/Dockerfile image: ghcr.io/username/image2 permissions: contents: read From 01852fcd4a9af65cba59daf6d812a5dcb767d423 Mon Sep 17 00:00:00 2001 From: Richmond Date: Tue, 13 Aug 2024 11:22:13 +0800 Subject: [PATCH 17/22] chore: Update deploy-image.yml to use consistent image naming --- .github/workflows/deploy-image.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-image.yml b/.github/workflows/deploy-image.yml index bc16502..eb13ae3 100644 --- a/.github/workflows/deploy-image.yml +++ b/.github/workflows/deploy-image.yml @@ -14,9 +14,9 @@ jobs: matrix: include: - dockerfile: ././client/Dockerfile - image: ghcr.io/username/image1 + image: ghcr.io/richmondramil/dockertestv1 - dockerfile: ././server/Dockerfile - image: ghcr.io/username/image2 + image: ghcr.io/richmondramil/dockertestv2 permissions: contents: read packages: write From dd3d2425e820aeeaff561d9f029e2c9773e57258 Mon Sep 17 00:00:00 2001 From: Richmond Date: Thu, 15 Aug 2024 09:06:00 +0800 Subject: [PATCH 18/22] chore: Update deploy-image.yml to use consistent image naming --- .github/workflows/deploy-image.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy-image.yml b/.github/workflows/deploy-image.yml index eb13ae3..7a094c2 100644 --- a/.github/workflows/deploy-image.yml +++ b/.github/workflows/deploy-image.yml @@ -13,9 +13,9 @@ jobs: fail-fast: false matrix: include: - - dockerfile: ././client/Dockerfile + - dockerfile: ./client/Dockerfile image: ghcr.io/richmondramil/dockertestv1 - - dockerfile: ././server/Dockerfile + - dockerfile: ./server/Dockerfile image: ghcr.io/richmondramil/dockertestv2 permissions: contents: read @@ -32,6 +32,10 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Generate date-based tag + id: date-tag + run: echo "DATE_TAG=$(date +'%Y%m%d')" >> $GITHUB_ENV + - name: Extract metadata (tags, labels) for Docker id: meta uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 @@ -40,6 +44,8 @@ jobs: tags: | type=ref,event=branch type=sha + type=date,format=yyyyMMdd + labels: ${{ steps.date-tag.outputs.DATE_TAG }} - name: Build and push Docker image uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc @@ -47,5 +53,5 @@ jobs: context: . file: ${{ matrix.dockerfile }} push: true - tags: ${{ steps.meta.outputs.tags }} + tags: ${{ steps.meta.outputs.tags }},${{ env.DATE_TAG }} labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file From 1c25fcab0f8c07827a068fd2ebe8cbc496b73478 Mon Sep 17 00:00:00 2001 From: Richmond Date: Thu, 15 Aug 2024 09:08:08 +0800 Subject: [PATCH 19/22] chore: Update deploy-image.yml to use consistent image naming --- .github/workflows/deploy-image.yml | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/.github/workflows/deploy-image.yml b/.github/workflows/deploy-image.yml index 7a094c2..fae290b 100644 --- a/.github/workflows/deploy-image.yml +++ b/.github/workflows/deploy-image.yml @@ -36,22 +36,16 @@ jobs: id: date-tag run: echo "DATE_TAG=$(date +'%Y%m%d')" >> $GITHUB_ENV - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 - with: - images: ${{ matrix.image }} - tags: | - type=ref,event=branch - type=sha - type=date,format=yyyyMMdd - labels: ${{ steps.date-tag.outputs.DATE_TAG }} - - name: Build and push Docker image uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc with: context: . file: ${{ matrix.dockerfile }} push: true - tags: ${{ steps.meta.outputs.tags }},${{ env.DATE_TAG }} - labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file + tags: | + ${{ matrix.image }}:latest + ${{ matrix.image }}:${{ env.DATE_TAG }} + labels: | + org.opencontainers.image.source=${{ github.repositoryUrl }} + org.opencontainers.image.revision=${{ github.sha }} + org.opencontainers.image.created=${{ steps.date-tag.outputs.DATE_TAG }} \ No newline at end of file From cfd89ceea48d2e7ddc29b804867b4c6a3411e999 Mon Sep 17 00:00:00 2001 From: Richmond Date: Thu, 15 Aug 2024 09:10:19 +0800 Subject: [PATCH 20/22] chore: Update deploy-image.yml to use consistent image naming --- .github/workflows/deploy-image.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-image.yml b/.github/workflows/deploy-image.yml index fae290b..75eeda2 100644 --- a/.github/workflows/deploy-image.yml +++ b/.github/workflows/deploy-image.yml @@ -34,7 +34,7 @@ jobs: - name: Generate date-based tag id: date-tag - run: echo "DATE_TAG=$(date +'%Y%m%d')" >> $GITHUB_ENV + run: echo "DATE_TAG=$(date +'%Y-%m-%d')" >> $GITHUB_ENV - name: Build and push Docker image uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc @@ -48,4 +48,4 @@ jobs: labels: | org.opencontainers.image.source=${{ github.repositoryUrl }} org.opencontainers.image.revision=${{ github.sha }} - org.opencontainers.image.created=${{ steps.date-tag.outputs.DATE_TAG }} \ No newline at end of file + org.opencontainers.image.created=${{ env.DATE_TAG }} \ No newline at end of file From 3f43e475c7e0e6e8d9226968cea3b975be082c2e Mon Sep 17 00:00:00 2001 From: Richmond Date: Thu, 15 Aug 2024 09:12:10 +0800 Subject: [PATCH 21/22] chore: Update deploy-image.yml to use consistent image naming --- .github/workflows/deploy-image.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-image.yml b/.github/workflows/deploy-image.yml index 75eeda2..dd64554 100644 --- a/.github/workflows/deploy-image.yml +++ b/.github/workflows/deploy-image.yml @@ -14,9 +14,9 @@ jobs: matrix: include: - dockerfile: ./client/Dockerfile - image: ghcr.io/richmondramil/dockertestv1 + image: ghcr.io/richmondramil/client - dockerfile: ./server/Dockerfile - image: ghcr.io/richmondramil/dockertestv2 + image: ghcr.io/richmondramil/server permissions: contents: read packages: write From 5f8de0f0259dab9401b23d9155a0eafbcb2c44b3 Mon Sep 17 00:00:00 2001 From: Richmond Date: Thu, 15 Aug 2024 09:21:03 +0800 Subject: [PATCH 22/22] chore: Update deploy-image.yml to use consistent image naming --- .github/workflows/deploy-image.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-image.yml b/.github/workflows/deploy-image.yml index dd64554..a424f0e 100644 --- a/.github/workflows/deploy-image.yml +++ b/.github/workflows/deploy-image.yml @@ -44,8 +44,8 @@ jobs: push: true tags: | ${{ matrix.image }}:latest - ${{ matrix.image }}:${{ env.DATE_TAG }} + ${{ matrix.image }}-${{ env.DATE_TAG }} labels: | org.opencontainers.image.source=${{ github.repositoryUrl }} org.opencontainers.image.revision=${{ github.sha }} - org.opencontainers.image.created=${{ env.DATE_TAG }} \ No newline at end of file + org.opencontainers.image.created=${{ env.DATE_TAG }}