From d58d0a93cbe58bebe6f11d9e47f89d6eb752fc72 Mon Sep 17 00:00:00 2001 From: Agung Sundoro Date: Sun, 27 Nov 2022 09:22:13 +0700 Subject: [PATCH 01/11] Update README.md add info to change avatar and cover --- README.md | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 0555222..7aab346 100644 --- a/README.md +++ b/README.md @@ -5,13 +5,15 @@ See the [demo][website] ## 🤖 Installation ### via docker run -` -docker run -d -p 80:80 - --name agung2001.github.io - -v /path/to/config.json:/usr/share/nginx/html/config.json - agung2001/agung2001.github.io:1.0.0 -` -- NOTE: Don't forget to change the `/path/to/config.json` accordingly +``` +docker run -d -p 80:80 \ + --name agung2001.github.io \ + -v /path/to/config.json:/usr/share/nginx/html/config.json \ + -v /path/to/avatar.jpg:/usr/share/nginx/html/assets/img/avatar.jpg \ + -v /path/to/cover.jpg:/usr/share/nginx/html/assets/img/cover.jpg \ + agung2001/agung2001.github.io:latest +``` +- NOTE: Don't forget to change the `/path/to/` accordingly ### via manual build - Install node package `npm i` @@ -21,7 +23,7 @@ docker run -d -p 80:80 ## 🔥 Development - Rename `.env-sample` to `.env` - Change `.env` according to your environment -- Docker `docker-compose up --build` +- Docker `docker-compose up` ## ⚒️ Built with - [Animate.style](https://animate.style/) From 800feb6984e5a4c205089db45fdff8a2133931da Mon Sep 17 00:00:00 2001 From: Agung Sundoro Date: Sun, 27 Nov 2022 09:30:51 +0700 Subject: [PATCH 02/11] Add Infrastructure info config.json --- config.json | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/config.json b/config.json index 613fc1a..3f5cc97 100644 --- a/config.json +++ b/config.json @@ -189,16 +189,20 @@ "https://cdn.jsdelivr.net/gh/devicons/devicon/icons/vscode/vscode-original.svg", "https://cdn.jsdelivr.net/gh/devicons/devicon/icons/jetbrains/jetbrains-original.svg", "https://cdn.jsdelivr.net/gh/devicons/devicon/icons/git/git-original.svg", - "https://cdn.jsdelivr.net/gh/devicons/devicon/icons/subversion/subversion-original.svg" + "https://cdn.jsdelivr.net/gh/devicons/devicon/icons/subversion/subversion-original.svg", + "https://cdn.jsdelivr.net/gh/devicons/devicon/icons/grunt/grunt-original.svg", + "https://cdn.jsdelivr.net/gh/devicons/devicon/icons/webpack/webpack-original.svg" ] }, { - "label": "Build", + "label": "Infrastructure", "tools": [ "https://cdn.jsdelivr.net/gh/devicons/devicon/icons/linux/linux-original.svg", "https://cdn.jsdelivr.net/gh/devicons/devicon/icons/docker/docker-original.svg", - "https://cdn.jsdelivr.net/gh/devicons/devicon/icons/grunt/grunt-original.svg", - "https://cdn.jsdelivr.net/gh/devicons/devicon/icons/webpack/webpack-original.svg" + "https://cdn.jsdelivr.net/gh/devicons/devicon/icons/digitalocean/digitalocean-original.svg", + "https://cdn.jsdelivr.net/gh/devicons/devicon/icons/amazonwebservices/amazonwebservices-original.svg", + "https://cdn.jsdelivr.net/gh/devicons/devicon/icons/googlecloud/googlecloud-original.svg", + "https://cdn.jsdelivr.net/gh/devicons/devicon/icons/firebase/firebase-plain.svg" ] } ] From b1fadf743c81b5cfdb52e1211fbf4970a15e88f8 Mon Sep 17 00:00:00 2001 From: Agung Sundoro Date: Sun, 27 Nov 2022 10:16:13 +0700 Subject: [PATCH 03/11] Initial test add github action package workflows --- .github/workflows/workflow.yml | 44 ++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/workflow.yml diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml new file mode 100644 index 0000000..f117971 --- /dev/null +++ b/.github/workflows/workflow.yml @@ -0,0 +1,44 @@ +name: Create and publish a Docker image + +push: + branches: + - master + - feature/packages + tags: + - '*' + +env: + GITHUB_GITHUB_REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + github-package: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Log in to the Container registry + uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 + with: + registry: ${{ env.GITHUB_REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 + with: + images: ${{ env.GITHUB_REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Build and push Docker image + uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file From 3aa9a0caaaee29c390dc27e3366a092098a59904 Mon Sep 17 00:00:00 2001 From: Agung Sundoro Date: Sun, 27 Nov 2022 10:17:45 +0700 Subject: [PATCH 04/11] HOTFIX: workflow.yml No event triggers defined in --- .github/workflows/workflow.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index f117971..e1c9f5b 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -1,11 +1,12 @@ name: Create and publish a Docker image -push: - branches: - - master - - feature/packages - tags: - - '*' +on: + push: + branches: + - master + - feature/packages + tags: + - '*' env: GITHUB_GITHUB_REGISTRY: ghcr.io From eaa52a9a560d9dd7f371e4dbb6da76734e9288da Mon Sep 17 00:00:00 2001 From: Agung Sundoro Date: Sun, 27 Nov 2022 10:23:20 +0700 Subject: [PATCH 05/11] Update docker/login-action and docker/metadata-action to latest version --- .github/workflows/workflow.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index e1c9f5b..3ec2fdd 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -9,7 +9,7 @@ on: - '*' env: - GITHUB_GITHUB_REGISTRY: ghcr.io + GITHUB_REGISTRY: ghcr.io IMAGE_NAME: ${{ github.repository }} jobs: @@ -24,7 +24,7 @@ jobs: uses: actions/checkout@v3 - name: Log in to the Container registry - uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 + uses: docker/login-action@v2 with: registry: ${{ env.GITHUB_REGISTRY }} username: ${{ github.actor }} @@ -32,12 +32,12 @@ jobs: - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 + uses: docker/metadata-action@v4 with: images: ${{ env.GITHUB_REGISTRY }}/${{ env.IMAGE_NAME }} - name: Build and push Docker image - uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc + uses: docker/build-push-action@v3 with: context: . push: true From 7c41023021d6b2b0355b0b36e5f612e6af794dee Mon Sep 17 00:00:00 2001 From: Agung Sundoro Date: Sun, 27 Nov 2022 10:29:24 +0700 Subject: [PATCH 06/11] Update README.md add image registry information --- .github/workflows/workflow.yml | 2 ++ README.md | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 3ec2fdd..bdafbd2 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -13,6 +13,8 @@ env: IMAGE_NAME: ${{ github.repository }} jobs: + + github-package: runs-on: ubuntu-latest permissions: diff --git a/README.md b/README.md index 7aab346..cc78056 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ docker run -d -p 80:80 \ -v /path/to/config.json:/usr/share/nginx/html/config.json \ -v /path/to/avatar.jpg:/usr/share/nginx/html/assets/img/avatar.jpg \ -v /path/to/cover.jpg:/usr/share/nginx/html/assets/img/cover.jpg \ - agung2001/agung2001.github.io:latest + agung2001/agung2001.github.io:master ``` - NOTE: Don't forget to change the `/path/to/` accordingly @@ -35,8 +35,9 @@ docker run -d -p 80:80 \ ## 📚 Resources - [Github](https://github.com/agung2001/agung2001.github.io) -- [Docker Hub](https://hub.docker.com/r/agung2001/agung2001.github.io) -- [Wiki](https://github.com/agung2001/agung2001.github.io/wiki/) +- Registry + - [Docker Hub](https://hub.docker.com/r/agung2001/agung2001.github.io) + - [GHCR](https://github.com/agung2001/agung2001.github.io/pkgs/container/agung2001.github.io) ## ⭐️ Support Help support me by giving a star or [donate][website] From f2a66598e39031700571fda01c9de1ecaa644a1a Mon Sep 17 00:00:00 2001 From: Agung Sundoro Date: Sun, 27 Nov 2022 10:30:31 +0700 Subject: [PATCH 07/11] Add job docker-hub workflow.yml --- .github/workflows/workflow.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index bdafbd2..87744b0 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -13,7 +13,35 @@ env: IMAGE_NAME: ${{ github.repository }} jobs: + docker-hub: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Log in to the Container registry + uses: docker/login-action@v2 + with: + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v4 + with: + images: ${{ env.GITHUB_REGISTRY }}/${{ env.IMAGE_NAME }} + - name: Build and push Docker image + uses: docker/build-push-action@v3 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} github-package: runs-on: ubuntu-latest From cde09d4ef055051bad70a6e4770e3a193da8b40b Mon Sep 17 00:00:00 2001 From: Agung Sundoro Date: Sun, 27 Nov 2022 10:52:16 +0700 Subject: [PATCH 08/11] Add shilds badge README.md --- .github/workflows/workflow.yml | 4 ++-- README.md | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 87744b0..695c2a8 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -26,8 +26,8 @@ jobs: - name: Log in to the Container registry uses: docker/login-action@v2 with: - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Extract metadata (tags, labels) for Docker id: meta diff --git a/README.md b/README.md index cc78056..5441bc8 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,13 @@ ![Screenshot](screenshot.png) My GitHub profile page. You can change the configuration of the page by changing [config.json](config.json) file and run the install. -See the [demo][website] +See the [demo][website]. + +![Stars](https://img.shields.io/github/stars/agung2001/agung2001.github.io?style=social) +![Size](https://img.shields.io/github/repo-size/agung2001/agung2001.github.io) +![Pulls](https://img.shields.io/docker/pulls/agung2001/agung2001.github.io) +![Image Size](https://img.shields.io/docker/image-size/agung2001/agung2001.github.io) +![Version](https://img.shields.io/docker/v/agung2001/agung2001.github.io) ## 🤖 Installation ### via docker run From 8bcc28b60ec0f59fc08eca52f3ff75b1f14ddd17 Mon Sep 17 00:00:00 2001 From: Agung Sundoro Date: Sun, 27 Nov 2022 10:57:38 +0700 Subject: [PATCH 09/11] Github action test 1 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5441bc8..2b23e73 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ See the [demo][website]. ![Version](https://img.shields.io/docker/v/agung2001/agung2001.github.io) ## 🤖 Installation -### via docker run +### via docker run ``` docker run -d -p 80:80 \ --name agung2001.github.io \ From f1f4fe8b798a478d357c694bebe62d921763d212 Mon Sep 17 00:00:00 2001 From: Agung Sundoro Date: Sun, 27 Nov 2022 11:03:19 +0700 Subject: [PATCH 10/11] Github action test 2 --- .github/workflows/workflow.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 695c2a8..e06d940 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -9,7 +9,6 @@ on: - '*' env: - GITHUB_REGISTRY: ghcr.io IMAGE_NAME: ${{ github.repository }} jobs: @@ -23,17 +22,17 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 - - name: Log in to the Container registry + - name: Login to Docker Hub uses: docker/login-action@v2 with: username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} - name: Extract metadata (tags, labels) for Docker id: meta uses: docker/metadata-action@v4 with: - images: ${{ env.GITHUB_REGISTRY }}/${{ env.IMAGE_NAME }} + images: ${{ env.IMAGE_NAME }} - name: Build and push Docker image uses: docker/build-push-action@v3 @@ -56,7 +55,7 @@ jobs: - name: Log in to the Container registry uses: docker/login-action@v2 with: - registry: ${{ env.GITHUB_REGISTRY }} + registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} @@ -64,7 +63,7 @@ jobs: id: meta uses: docker/metadata-action@v4 with: - images: ${{ env.GITHUB_REGISTRY }}/${{ env.IMAGE_NAME }} + images: ghcr.io/${{ env.IMAGE_NAME }} - name: Build and push Docker image uses: docker/build-push-action@v3 From 2932305e13dd404628cc65d7fbace5de4c57a974 Mon Sep 17 00:00:00 2001 From: Agung Sundoro Date: Sun, 27 Nov 2022 11:07:02 +0700 Subject: [PATCH 11/11] Github action test 3 --- .github/workflows/workflow.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index e06d940..aecc3a2 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -23,6 +23,7 @@ jobs: uses: actions/checkout@v3 - name: Login to Docker Hub + if: github.event_name != 'pull_request' uses: docker/login-action@v2 with: username: ${{ secrets.DOCKERHUB_USERNAME }} @@ -53,6 +54,7 @@ jobs: uses: actions/checkout@v3 - name: Log in to the Container registry + if: github.event_name != 'pull_request' uses: docker/login-action@v2 with: registry: ghcr.io