From fc71e1d745f7c74b8f936d53c753e54ac2eb3798 Mon Sep 17 00:00:00 2001 From: m1sse <74245214+m1sse@users.noreply.github.com> Date: Wed, 22 Jun 2022 12:05:02 +0700 Subject: [PATCH 01/29] Create Dockerfile --- Dockerfile | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..864533bc7 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,6 @@ +FROM nginx:alpine + +COPY /angular/dist/angular-starter /usr/share/nginx/html +COPY nginx.conf /etc/nginx/nginx.conf + +EXPOSE 8080 \ No newline at end of file From cb89cdc7b1dc0e723c5ee9b65894b40271511c07 Mon Sep 17 00:00:00 2001 From: m1sse <74245214+m1sse@users.noreply.github.com> Date: Wed, 22 Jun 2022 12:09:39 +0700 Subject: [PATCH 02/29] 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 000000000..eac633f69 --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,18 @@ +name: Docker Image CI + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Build the Docker image + run: docker build . --file Dockerfile --tag my-image-name:$(date +%s) From 0e23bcfaa31973e6d00e2b6e7e61ecaa6bb0f830 Mon Sep 17 00:00:00 2001 From: m1sse <74245214+m1sse@users.noreply.github.com> Date: Wed, 22 Jun 2022 12:18:24 +0700 Subject: [PATCH 03/29] Update docker-image.yml --- .github/workflows/docker-image.yml | 52 ++++++++++++++++++++++-------- 1 file changed, 38 insertions(+), 14 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index eac633f69..65be51f75 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -1,18 +1,42 @@ -name: Docker Image CI - -on: - push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] - +name: CI of angular +on: push jobs: - + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Use Node.js 14.x + uses: actions/setup-node@v1 + with: + node-version: 14.x + - name: Setup + run: npm i + - name: Test + run: npm run test build: - runs-on: ubuntu-latest - + needs: test steps: - - uses: actions/checkout@v3 - - name: Build the Docker image - run: docker build . --file Dockerfile --tag my-image-name:$(date +%s) + - name: Checkout + uses: actions/checkout@v2 + - name: Use Node.js 14.x + uses: actions/setup-node@v1 + with: + node-version: 14.x + - name: Setup + run: npm i + - name: Build + run: npm run build + - name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push to GitHub + id: docker_build + uses: docker/build-push-action@v2 + with: + context: . + push: true + tags: ghcr.io/zunchi/angular-starter:latest From b2b5d92c23c6bd9408f2a44d87352ed9788bcac7 Mon Sep 17 00:00:00 2001 From: m1sse <74245214+m1sse@users.noreply.github.com> Date: Wed, 22 Jun 2022 12:21:00 +0700 Subject: [PATCH 04/29] Update docker-image.yml --- .github/workflows/docker-image.yml | 44 +++++++----------------------- 1 file changed, 10 insertions(+), 34 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 65be51f75..50f57b8bf 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -1,42 +1,18 @@ -name: CI of angular +name: CI pipeline for test task on: push jobs: - test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Use Node.js 14.x - uses: actions/setup-node@v1 - with: - node-version: 14.x - - name: Setup - run: npm i - - name: Test - run: npm run test build: runs-on: ubuntu-latest - needs: test steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Use Node.js 14.x + ‐ uses: actions/checkout@v2 + ‐ name: Use Node.js 14.x uses: actions/setup-node@v1 with: node-version: 14.x - - name: Setup - run: npm i - - name: Build - run: npm run build - - name: Login to GitHub Container Registry - uses: docker/login-action@v1 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and push to GitHub - id: docker_build - uses: docker/build-push-action@v2 - with: - context: . - push: true - tags: ghcr.io/zunchi/angular-starter:latest + + ‐ name: Setup + run: npm ci + + ‐ name: Test + run: | + npm test -- --no-watch --no-progress --browsers=ChromeHeadlessCI From c63061f0f8f9b8b2dbcec13bf56bb5ce06a9ea87 Mon Sep 17 00:00:00 2001 From: m1sse <74245214+m1sse@users.noreply.github.com> Date: Wed, 22 Jun 2022 12:28:54 +0700 Subject: [PATCH 05/29] Create docker-publish.yml --- .github/workflows/docker-publish.yml | 93 ++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 .github/workflows/docker-publish.yml diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml new file mode 100644 index 000000000..455923d7e --- /dev/null +++ b/.github/workflows/docker-publish.yml @@ -0,0 +1,93 @@ +name: Docker + +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +on: + schedule: + - cron: '15 4 * * *' + push: + branches: [ "master" ] + # Publish semver tags as releases. + tags: [ 'v*.*.*' ] + pull_request: + branches: [ "master" ] + +env: + # Use docker.io for Docker Hub if empty + REGISTRY: ghcr.io + # github.repository as / + IMAGE_NAME: ${{ github.repository }} + + +jobs: + build: + + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + # This is used to complete the identity challenge + # with sigstore/fulcio when running outside of PRs. + id-token: write + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + # Install the cosign tool except on PR + # https://github.com/sigstore/cosign-installer + - name: Install cosign + if: github.event_name != 'pull_request' + uses: sigstore/cosign-installer@d6a3abf1bdea83574e28d40543793018b6035605 + with: + cosign-release: 'v1.7.1' + + + # Workaround: https://github.com/docker/build-push-action/issues/461 + - name: Setup Docker buildx + uses: docker/setup-buildx-action@79abd3f86f79a9d68a23c75a09a9a85889262adf + + # Login against a Docker registry except on PR + # https://github.com/docker/login-action + - name: Log into registry ${{ env.REGISTRY }} + if: github.event_name != 'pull_request' + uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + # Extract metadata (tags, labels) for Docker + # https://github.com/docker/metadata-action + - name: Extract Docker metadata + id: meta + uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + # Build and push Docker image with Buildx (don't push on PR) + # https://github.com/docker/build-push-action + - name: Build and push Docker image + id: build-and-push + uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a + with: + context: . + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + + # Sign the resulting Docker image digest except on PRs. + # This will only write to the public Rekor transparency log when the Docker + # repository is public to avoid leaking data. If you would like to publish + # transparency data even for private images, pass --force to cosign below. + # https://github.com/sigstore/cosign + - name: Sign the published Docker image + if: ${{ github.event_name != 'pull_request' }} + env: + COSIGN_EXPERIMENTAL: "true" + # This step uses the identity token to provision an ephemeral certificate + # against the sigstore community Fulcio instance. + run: cosign sign ${{ steps.meta.outputs.tags }}@${{ steps.build-and-push.outputs.digest }} From 6fab610913f4b0b9de41181eafa9d07ad6028d1a Mon Sep 17 00:00:00 2001 From: m1sse <74245214+m1sse@users.noreply.github.com> Date: Wed, 22 Jun 2022 12:31:22 +0700 Subject: [PATCH 06/29] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 43 ---------------------------- 1 file changed, 43 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 455923d7e..ddfd05756 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -6,8 +6,6 @@ name: Docker # documentation. on: - schedule: - - cron: '15 4 * * *' push: branches: [ "master" ] # Publish semver tags as releases. @@ -37,15 +35,6 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 - # Install the cosign tool except on PR - # https://github.com/sigstore/cosign-installer - - name: Install cosign - if: github.event_name != 'pull_request' - uses: sigstore/cosign-installer@d6a3abf1bdea83574e28d40543793018b6035605 - with: - cosign-release: 'v1.7.1' - - # Workaround: https://github.com/docker/build-push-action/issues/461 - name: Setup Docker buildx uses: docker/setup-buildx-action@79abd3f86f79a9d68a23c75a09a9a85889262adf @@ -59,35 +48,3 @@ jobs: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - # Extract metadata (tags, labels) for Docker - # https://github.com/docker/metadata-action - - name: Extract Docker metadata - id: meta - uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - - # Build and push Docker image with Buildx (don't push on PR) - # https://github.com/docker/build-push-action - - name: Build and push Docker image - id: build-and-push - uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a - with: - context: . - push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - - # Sign the resulting Docker image digest except on PRs. - # This will only write to the public Rekor transparency log when the Docker - # repository is public to avoid leaking data. If you would like to publish - # transparency data even for private images, pass --force to cosign below. - # https://github.com/sigstore/cosign - - name: Sign the published Docker image - if: ${{ github.event_name != 'pull_request' }} - env: - COSIGN_EXPERIMENTAL: "true" - # This step uses the identity token to provision an ephemeral certificate - # against the sigstore community Fulcio instance. - run: cosign sign ${{ steps.meta.outputs.tags }}@${{ steps.build-and-push.outputs.digest }} From 89aa2d9a85875cd4094b76687854631411fbdf4b Mon Sep 17 00:00:00 2001 From: m1sse <74245214+m1sse@users.noreply.github.com> Date: Wed, 22 Jun 2022 13:09:08 +0700 Subject: [PATCH 07/29] test1 --- .github/workflows/test1.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/test1.yml diff --git a/.github/workflows/test1.yml b/.github/workflows/test1.yml new file mode 100644 index 000000000..eac633f69 --- /dev/null +++ b/.github/workflows/test1.yml @@ -0,0 +1,18 @@ +name: Docker Image CI + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Build the Docker image + run: docker build . --file Dockerfile --tag my-image-name:$(date +%s) From 229659336a8effbaf92be698b2b6813782cea578 Mon Sep 17 00:00:00 2001 From: m1sse <74245214+m1sse@users.noreply.github.com> Date: Wed, 22 Jun 2022 13:09:34 +0700 Subject: [PATCH 08/29] Create test2.yml --- .github/workflows/test2.yml | 57 +++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/test2.yml diff --git a/.github/workflows/test2.yml b/.github/workflows/test2.yml new file mode 100644 index 000000000..471c976c9 --- /dev/null +++ b/.github/workflows/test2.yml @@ -0,0 +1,57 @@ +name: CI + +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the master branch + push: + branches: [ master ] + + # 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: + # - name: List direction + # run : ls -la + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + + #- name: List direction + # run : ls -la + + - name: Build Docker image from Dockerfile + run : | + docker build -t abe_angular . + + - name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + # - name: Set the Tag on Container Registry + # run : | + + - name: Build and push + id: docker_build + uses: docker/build-push-action@v2 + with: + context: ./ + file: ./Dockerfile + builder: ${{ steps.buildx.outputs.name }} + push: true + tags: angular-starter/abe_angular:v1.0 + #cache-from: type=local,src=/tmp/.buildx-cache + #cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Show Docker images + run : docker images From a9a9b91a9b13e06d420e3274d8bd3ddeb7e71190 Mon Sep 17 00:00:00 2001 From: m1sse <74245214+m1sse@users.noreply.github.com> Date: Wed, 22 Jun 2022 13:16:07 +0700 Subject: [PATCH 09/29] Create test3.yml --- .github/workflows/test3.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/test3.yml diff --git a/.github/workflows/test3.yml b/.github/workflows/test3.yml new file mode 100644 index 000000000..eac633f69 --- /dev/null +++ b/.github/workflows/test3.yml @@ -0,0 +1,18 @@ +name: Docker Image CI + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Build the Docker image + run: docker build . --file Dockerfile --tag my-image-name:$(date +%s) From a549aa7447cfaa4c89d222e6b5488acb8641b886 Mon Sep 17 00:00:00 2001 From: m1sse Date: Thu, 14 Jul 2022 00:30:32 +0700 Subject: [PATCH 10/29] 1 --- Dockerfile | 8 ++++++-- angular/angular.json | 3 ++- angular/nginx.conf | 6 +++--- nginx.conf | 44 ++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 55 insertions(+), 6 deletions(-) create mode 100644 nginx.conf diff --git a/Dockerfile b/Dockerfile index 864533bc7..7b7a1694d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,10 @@ FROM nginx:alpine -COPY /angular/dist/angular-starter /usr/share/nginx/html +RUN chown -R nginx:nginx /var/log/nginx \ + && chown -R nginx:nginx /etc/nginx/nginx.conf + + COPY nginx.conf /etc/nginx/nginx.conf +COPY angular/dist/angular-starter /var/www/html -EXPOSE 8080 \ No newline at end of file +EXPOSE 80 diff --git a/angular/angular.json b/angular/angular.json index a793f76c4..c00948b27 100644 --- a/angular/angular.json +++ b/angular/angular.json @@ -112,6 +112,7 @@ } }, "cli": { - "defaultCollection": "@angular-eslint/schematics" + "defaultCollection": "@angular-eslint/schematics", + "analytics": "74d2ecca-b905-4459-b7d8-89e9b09546c8" } } diff --git a/angular/nginx.conf b/angular/nginx.conf index ca9adbf52..60edf1baa 100644 --- a/angular/nginx.conf +++ b/angular/nginx.conf @@ -1,4 +1,4 @@ -user www-data; +user nobody; worker_processes auto; pid /run/nginx.pid; include /etc/nginx/modules-enabled/*.conf; @@ -27,8 +27,8 @@ http { include /etc/nginx/conf.d/*.conf; server { - listen 80 default_server; - listen [::]:80 default_server; + listen 8080 default_server; + listen [::]:8080 default_server; root /var/www/html; index index.html index.htm index.nginx-debian.html; diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 000000000..f82e77a00 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,44 @@ +user nginx; +worker_processes auto; +pid /run/nginx.pid; +include /etc/nginx/modules-enabled/*.conf; + +events { + worker_connections 768; +} + +http { + sendfile on; + tcp_nopush on; + tcp_nodelay on; + keepalive_timeout 65; + types_hash_max_size 2048; + include /etc/nginx/mime.types; + default_type application/octet-stream; + + ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE + ssl_prefer_server_ciphers on; + + access_log /var/log/nginx/access.log; + error_log /var/log/nginx/error.log; + + gzip on; + + include /etc/nginx/conf.d/*.conf; + + server { + listen 80 default_server; + listen [::]:80 default_server; + root /var/www/html; + index index.html index.htm index.nginx-debian.html; + + server_name _; + + location / { + try_files $uri $uri/ =404; + } + + } + +} + From 45fd0ad1917b5d1cae86ea2d10ce7fcb79c3edac Mon Sep 17 00:00:00 2001 From: m1sse <74245214+m1sse@users.noreply.github.com> Date: Thu, 14 Jul 2022 00:42:01 +0700 Subject: [PATCH 11/29] Update test1.yml --- .github/workflows/test1.yml | 170 +++++++++++++++++++++++++++++++++--- 1 file changed, 160 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test1.yml b/.github/workflows/test1.yml index eac633f69..c8de72702 100644 --- a/.github/workflows/test1.yml +++ b/.github/workflows/test1.yml @@ -1,18 +1,168 @@ -name: Docker Image CI +Skip to content +Search or jump to… +Pull requests +Issues +Marketplace +Explore + +@m1sse +v-inter +/ +angular-react-starter +Public +forked from ganatan/angular-react-starter +Code +Pull requests +Actions +Projects +Wiki +Security +Insights +angular-react-starter/.github/workflows/ci.yml +@v-inter +v-inter Update ci.yml +Latest commit 459219e 6 days ago + History + 1 contributor +125 lines (105 sloc) 3.69 KB -on: - push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] +name: CI + +on: push +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} ${{ github.sha }} jobs: + ### Test + test: + runs-on: ubuntu-latest + + outputs: + output_time: ${{ steps.time_start.outputs.JOB_START_TIME }} + + defaults: + run: + working-directory: ./angular + steps: + - uses: actions/checkout@v3 - build: + - name: Get time start workflow + run: echo "::set-output name=JOB_START_TIME::$(date +%s)" + id: time_start + - run: echo "${{ github.actor }}" + - run: echo "${{ secrets.GITHUB_TOKEN }}" + - name: Use Node.js +# if: ${{ github.ref }} == 'develop' + uses: actions/setup-node@v3 + with: + node-version: 16.x + - run: npm install + - run: npm ci + - run: npm run build --if-present + - run: npm test -- --watch=false --browsers=ChromeHeadless + + ### Sending email when test is failed + - uses: actions/checkout@v3 + - name: Send mail + if: ${{ failure() }} + run: echo " send email" +# uses: ./.github/actions/send-email +# with: +# username: ${{secrets.MAIL_USERNAME}} +# password: ${{secrets.MAIL_PASSWORD}} +# to: ${{secrets.MAIL_ADDRESS}} # Required recipients' addresses: +# body: Testing of ${{github.repository}} is failed! +# reply_to: ${{secrets.MAIL_USERNAME}} + + ### build + build-and-push-image: + needs: ['test'] runs-on: ubuntu-latest + defaults: + run: + working-directory: ./angular + + permissions: + contents: read + packages: write + steps: - - uses: actions/checkout@v3 - - name: Build the Docker image - run: docker build . --file Dockerfile --tag my-image-name:$(date +%s) + - uses: actions/checkout@v3 + + - name: Use Node.js +# if: ${{ github.ref }} == 'develop' + uses: actions/setup-node@v3 + with: + node-version: 16.x + - run: npm ci + - run: npm run build --prod + + - name: Log in to the Container registry + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY }} +# username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + username: ${{secrets.DOKERHUB_USERNAME}} +# password: ${{secrets.DOKERHUB_ACCESS_KEY}} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v4 + with: + images: ${{ env.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 }} + + - name: Create message body failure + if: ${{ failure() }} + run: echo "message_body=Build job of ${{github.repository}} is failed!" >> $GITHUB_ENV + + - name: Get time end workflow + run: echo "::set-output name=JOB_END_TIME::$(date +%s)" + id: time_end + + - name: Get execution time + run: | + let time_delta=${{ steps.time_end.outputs.JOB_END_TIME }}-${{ needs.test.outputs.output_time }} + echo "::set-output name=JOB_EXECUTION_TIME::$(echo $time_delta)" + id: execution_time + + - name: Create message body success + if: ${{ success() }} + run: echo "message_body=Build job of ${{github.repository}} is success! Duration was ${{ steps.execution_time.outputs.JOB_EXECUTION_TIME }} seconds" >> $GITHUB_ENV + + ### Sending email when deploy successfully of failure + - uses: actions/checkout@v3 + - name: Send mail + uses: ./.github/actions/send-email + with: + username: ${{secrets.MAIL_USERNAME}} + password: ${{secrets.MAIL_PASSWORD}} + to: ${{secrets.MAIL_ADDRESS}} + body: ${{env.message_body}} + reply_to: ${{secrets.MAIL_USERNAME}} +Footer +© 2022 GitHub, Inc. +Footer navigation +Terms +Privacy +Security +Status +Docs +Contact GitHub +Pricing +API +Training +Blog +About +You have no unread notifications From 4cb67d85923d9a2828358d75e2a626a204e8b8a6 Mon Sep 17 00:00:00 2001 From: m1sse <74245214+m1sse@users.noreply.github.com> Date: Thu, 14 Jul 2022 00:44:12 +0700 Subject: [PATCH 12/29] Delete docker-image.yml --- .github/workflows/docker-image.yml | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 .github/workflows/docker-image.yml diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml deleted file mode 100644 index 50f57b8bf..000000000 --- a/.github/workflows/docker-image.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: CI pipeline for test task -on: push -jobs: - build: - runs-on: ubuntu-latest - steps: - ‐ uses: actions/checkout@v2 - ‐ name: Use Node.js 14.x - uses: actions/setup-node@v1 - with: - node-version: 14.x - - ‐ name: Setup - run: npm ci - - ‐ name: Test - run: | - npm test -- --no-watch --no-progress --browsers=ChromeHeadlessCI From a2f924e960946d7eba07a5296db465a5f7d57859 Mon Sep 17 00:00:00 2001 From: m1sse <74245214+m1sse@users.noreply.github.com> Date: Thu, 14 Jul 2022 00:44:24 +0700 Subject: [PATCH 13/29] Delete docker-publish.yml --- .github/workflows/docker-publish.yml | 50 ---------------------------- 1 file changed, 50 deletions(-) delete mode 100644 .github/workflows/docker-publish.yml diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml deleted file mode 100644 index ddfd05756..000000000 --- a/.github/workflows/docker-publish.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: Docker - -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - -on: - push: - branches: [ "master" ] - # Publish semver tags as releases. - tags: [ 'v*.*.*' ] - pull_request: - branches: [ "master" ] - -env: - # Use docker.io for Docker Hub if empty - REGISTRY: ghcr.io - # github.repository as / - IMAGE_NAME: ${{ github.repository }} - - -jobs: - build: - - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - # This is used to complete the identity challenge - # with sigstore/fulcio when running outside of PRs. - id-token: write - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - # Workaround: https://github.com/docker/build-push-action/issues/461 - - name: Setup Docker buildx - uses: docker/setup-buildx-action@79abd3f86f79a9d68a23c75a09a9a85889262adf - - # Login against a Docker registry except on PR - # https://github.com/docker/login-action - - name: Log into registry ${{ env.REGISTRY }} - if: github.event_name != 'pull_request' - uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} From e6a1be40bac6b7d8df8a09b6bcfb7dcdf909cea0 Mon Sep 17 00:00:00 2001 From: m1sse <74245214+m1sse@users.noreply.github.com> Date: Thu, 14 Jul 2022 00:44:31 +0700 Subject: [PATCH 14/29] Delete test2.yml --- .github/workflows/test2.yml | 57 ------------------------------------- 1 file changed, 57 deletions(-) delete mode 100644 .github/workflows/test2.yml diff --git a/.github/workflows/test2.yml b/.github/workflows/test2.yml deleted file mode 100644 index 471c976c9..000000000 --- a/.github/workflows/test2.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: CI - -# Controls when the workflow will run -on: - # Triggers the workflow on push or pull request events but only for the master branch - push: - branches: [ master ] - - # 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: - # - name: List direction - # run : ls -la - - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 - - #- name: List direction - # run : ls -la - - - name: Build Docker image from Dockerfile - run : | - docker build -t abe_angular . - - - name: Login to GitHub Container Registry - uses: docker/login-action@v1 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - # - name: Set the Tag on Container Registry - # run : | - - - name: Build and push - id: docker_build - uses: docker/build-push-action@v2 - with: - context: ./ - file: ./Dockerfile - builder: ${{ steps.buildx.outputs.name }} - push: true - tags: angular-starter/abe_angular:v1.0 - #cache-from: type=local,src=/tmp/.buildx-cache - #cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Show Docker images - run : docker images From 14abed6a3cd12da026d01a27a05580aa93d2b549 Mon Sep 17 00:00:00 2001 From: m1sse <74245214+m1sse@users.noreply.github.com> Date: Thu, 14 Jul 2022 00:44:37 +0700 Subject: [PATCH 15/29] Delete test3.yml --- .github/workflows/test3.yml | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 .github/workflows/test3.yml diff --git a/.github/workflows/test3.yml b/.github/workflows/test3.yml deleted file mode 100644 index eac633f69..000000000 --- a/.github/workflows/test3.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Docker Image CI - -on: - push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] - -jobs: - - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - name: Build the Docker image - run: docker build . --file Dockerfile --tag my-image-name:$(date +%s) From 41d5e9f8d54d46242e83be884a9d16d23700a778 Mon Sep 17 00:00:00 2001 From: m1sse <74245214+m1sse@users.noreply.github.com> Date: Thu, 14 Jul 2022 00:45:38 +0700 Subject: [PATCH 16/29] ci --- .github/workflows/test1.yml | 43 ------------------------------------- 1 file changed, 43 deletions(-) diff --git a/.github/workflows/test1.yml b/.github/workflows/test1.yml index c8de72702..d82152dd0 100644 --- a/.github/workflows/test1.yml +++ b/.github/workflows/test1.yml @@ -1,31 +1,3 @@ -Skip to content -Search or jump to… -Pull requests -Issues -Marketplace -Explore - -@m1sse -v-inter -/ -angular-react-starter -Public -forked from ganatan/angular-react-starter -Code -Pull requests -Actions -Projects -Wiki -Security -Insights -angular-react-starter/.github/workflows/ci.yml -@v-inter -v-inter Update ci.yml -Latest commit 459219e 6 days ago - History - 1 contributor -125 lines (105 sloc) 3.69 KB - name: CI on: push @@ -151,18 +123,3 @@ jobs: to: ${{secrets.MAIL_ADDRESS}} body: ${{env.message_body}} reply_to: ${{secrets.MAIL_USERNAME}} -Footer -© 2022 GitHub, Inc. -Footer navigation -Terms -Privacy -Security -Status -Docs -Contact GitHub -Pricing -API -Training -Blog -About -You have no unread notifications From 779ab2024f3d48d0dc642a3814f64414e55110fe Mon Sep 17 00:00:00 2001 From: m1sse <74245214+m1sse@users.noreply.github.com> Date: Thu, 14 Jul 2022 00:46:12 +0700 Subject: [PATCH 17/29] Rename test1.yml to ci.yml --- .github/workflows/{test1.yml => ci.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{test1.yml => ci.yml} (100%) diff --git a/.github/workflows/test1.yml b/.github/workflows/ci.yml similarity index 100% rename from .github/workflows/test1.yml rename to .github/workflows/ci.yml From 41951d97abfd1d6d9aa952a11f7aa65d07652319 Mon Sep 17 00:00:00 2001 From: m1sse <74245214+m1sse@users.noreply.github.com> Date: Thu, 14 Jul 2022 00:49:28 +0700 Subject: [PATCH 18/29] Update ci.yml --- .github/workflows/ci.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d82152dd0..f1a2acd4c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,16 +37,6 @@ jobs: ### Sending email when test is failed - uses: actions/checkout@v3 - - name: Send mail - if: ${{ failure() }} - run: echo " send email" -# uses: ./.github/actions/send-email -# with: -# username: ${{secrets.MAIL_USERNAME}} -# password: ${{secrets.MAIL_PASSWORD}} -# to: ${{secrets.MAIL_ADDRESS}} # Required recipients' addresses: -# body: Testing of ${{github.repository}} is failed! -# reply_to: ${{secrets.MAIL_USERNAME}} ### build build-and-push-image: From 190ede2f020c982c658c79f303b882927d430311 Mon Sep 17 00:00:00 2001 From: m1sse <74245214+m1sse@users.noreply.github.com> Date: Thu, 14 Jul 2022 00:50:58 +0700 Subject: [PATCH 19/29] 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 000000000..eac633f69 --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,18 @@ +name: Docker Image CI + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Build the Docker image + run: docker build . --file Dockerfile --tag my-image-name:$(date +%s) From e51e807594e4bf7164b14bb2c044493fa14c342c Mon Sep 17 00:00:00 2001 From: m1sse <74245214+m1sse@users.noreply.github.com> Date: Thu, 14 Jul 2022 00:54:24 +0700 Subject: [PATCH 20/29] Update ci.yml --- .github/workflows/ci.yml | 68 +--------------------------------------- 1 file changed, 1 insertion(+), 67 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f1a2acd4c..720ba55d3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,74 +36,7 @@ jobs: - run: npm test -- --watch=false --browsers=ChromeHeadless ### Sending email when test is failed - - uses: actions/checkout@v3 - - ### build - build-and-push-image: - needs: ['test'] - runs-on: ubuntu-latest - - defaults: - run: - working-directory: ./angular - - permissions: - contents: read - packages: write - steps: - - uses: actions/checkout@v3 - - - name: Use Node.js -# if: ${{ github.ref }} == 'develop' - uses: actions/setup-node@v3 - with: - node-version: 16.x - - run: npm ci - - run: npm run build --prod - - - name: Log in to the Container registry - uses: docker/login-action@v2 - with: - registry: ${{ env.REGISTRY }} -# username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - username: ${{secrets.DOKERHUB_USERNAME}} -# password: ${{secrets.DOKERHUB_ACCESS_KEY}} - - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@v4 - with: - images: ${{ env.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 }} - - - name: Create message body failure - if: ${{ failure() }} - run: echo "message_body=Build job of ${{github.repository}} is failed!" >> $GITHUB_ENV - - - name: Get time end workflow - run: echo "::set-output name=JOB_END_TIME::$(date +%s)" - id: time_end - - - name: Get execution time - run: | - let time_delta=${{ steps.time_end.outputs.JOB_END_TIME }}-${{ needs.test.outputs.output_time }} - echo "::set-output name=JOB_EXECUTION_TIME::$(echo $time_delta)" - id: execution_time - - - name: Create message body success - if: ${{ success() }} - run: echo "message_body=Build job of ${{github.repository}} is success! Duration was ${{ steps.execution_time.outputs.JOB_EXECUTION_TIME }} seconds" >> $GITHUB_ENV - - ### Sending email when deploy successfully of failure - uses: actions/checkout@v3 - name: Send mail uses: ./.github/actions/send-email @@ -113,3 +46,4 @@ jobs: to: ${{secrets.MAIL_ADDRESS}} body: ${{env.message_body}} reply_to: ${{secrets.MAIL_USERNAME}} + From 2807286a20cca743fd3da8708d7e75d79485a1d0 Mon Sep 17 00:00:00 2001 From: m1sse <74245214+m1sse@users.noreply.github.com> Date: Thu, 14 Jul 2022 00:59:31 +0700 Subject: [PATCH 21/29] Delete ci.yml --- .github/workflows/ci.yml | 49 ---------------------------------------- 1 file changed, 49 deletions(-) delete mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 720ba55d3..000000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: CI - -on: push -env: - REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} ${{ github.sha }} - -jobs: - ### Test - test: - runs-on: ubuntu-latest - - outputs: - output_time: ${{ steps.time_start.outputs.JOB_START_TIME }} - - defaults: - run: - working-directory: ./angular - steps: - - uses: actions/checkout@v3 - - - name: Get time start workflow - run: echo "::set-output name=JOB_START_TIME::$(date +%s)" - id: time_start - - run: echo "${{ github.actor }}" - - run: echo "${{ secrets.GITHUB_TOKEN }}" - - - name: Use Node.js -# if: ${{ github.ref }} == 'develop' - uses: actions/setup-node@v3 - with: - node-version: 16.x - - run: npm install - - run: npm ci - - run: npm run build --if-present - - run: npm test -- --watch=false --browsers=ChromeHeadless - - ### Sending email when test is failed - - - uses: actions/checkout@v3 - - name: Send mail - uses: ./.github/actions/send-email - with: - username: ${{secrets.MAIL_USERNAME}} - password: ${{secrets.MAIL_PASSWORD}} - to: ${{secrets.MAIL_ADDRESS}} - body: ${{env.message_body}} - reply_to: ${{secrets.MAIL_USERNAME}} - From f99f6fa579e7618fd5be4df17f59913eec9767a3 Mon Sep 17 00:00:00 2001 From: m1sse Date: Thu, 14 Jul 2022 01:03:25 +0700 Subject: [PATCH 22/29] 2 --- Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7b7a1694d..3c1d6011c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,8 +3,9 @@ FROM nginx:alpine RUN chown -R nginx:nginx /var/log/nginx \ && chown -R nginx:nginx /etc/nginx/nginx.conf - +WORKDIR /angular/dist/angular-starter COPY nginx.conf /etc/nginx/nginx.conf -COPY angular/dist/angular-starter /var/www/html +COPY /angular/dist/angular-starter /var/www/html + EXPOSE 80 From 4f63d49395e772c1c05ba4d5ff5f4f5565ca8c26 Mon Sep 17 00:00:00 2001 From: m1sse Date: Thu, 14 Jul 2022 01:05:46 +0700 Subject: [PATCH 23/29] 3 --- Dockerfile | 3 --- 1 file changed, 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3c1d6011c..ea844ae8e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,9 +3,6 @@ FROM nginx:alpine RUN chown -R nginx:nginx /var/log/nginx \ && chown -R nginx:nginx /etc/nginx/nginx.conf -WORKDIR /angular/dist/angular-starter COPY nginx.conf /etc/nginx/nginx.conf -COPY /angular/dist/angular-starter /var/www/html - EXPOSE 80 From e7a44f349d76b3636f32106e1c3a01eb02f96d27 Mon Sep 17 00:00:00 2001 From: m1sse Date: Thu, 14 Jul 2022 01:10:37 +0700 Subject: [PATCH 24/29] 4 --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index ea844ae8e..17fccddaf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,6 +3,9 @@ FROM nginx:alpine RUN chown -R nginx:nginx /var/log/nginx \ && chown -R nginx:nginx /etc/nginx/nginx.conf +WORKDIR /angular/dist/angular-starter/ COPY nginx.conf /etc/nginx/nginx.conf +COPY /angular/dist/angular-starter/ /var/www/html + EXPOSE 80 From 3bedc12836571385acbec83229be404d2516b870 Mon Sep 17 00:00:00 2001 From: m1sse Date: Thu, 14 Jul 2022 01:13:32 +0700 Subject: [PATCH 25/29] 5 --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 17fccddaf..7c6d98a22 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,9 +3,9 @@ FROM nginx:alpine RUN chown -R nginx:nginx /var/log/nginx \ && chown -R nginx:nginx /etc/nginx/nginx.conf -WORKDIR /angular/dist/angular-starter/ + COPY nginx.conf /etc/nginx/nginx.conf -COPY /angular/dist/angular-starter/ /var/www/html +COPY ./angular/dist/angular-starter/ /var/www/html EXPOSE 80 From e92f8cc2929af96042d6755442df7ac71cef820d Mon Sep 17 00:00:00 2001 From: m1sse Date: Thu, 14 Jul 2022 01:15:01 +0700 Subject: [PATCH 26/29] 6 --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7c6d98a22..6f57e5c40 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,9 +3,9 @@ FROM nginx:alpine RUN chown -R nginx:nginx /var/log/nginx \ && chown -R nginx:nginx /etc/nginx/nginx.conf - +WORKDIR /angular/dist/angular-starter/ COPY nginx.conf /etc/nginx/nginx.conf -COPY ./angular/dist/angular-starter/ /var/www/html +COPY /angular/dist/angular-starter /var/www/html EXPOSE 80 From 46a2923819d2e32b347062b6b700c340f1a0cd2d Mon Sep 17 00:00:00 2001 From: m1sse Date: Thu, 14 Jul 2022 01:18:18 +0700 Subject: [PATCH 27/29] 7 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 6f57e5c40..91f36393d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ FROM nginx:alpine RUN chown -R nginx:nginx /var/log/nginx \ && chown -R nginx:nginx /etc/nginx/nginx.conf -WORKDIR /angular/dist/angular-starter/ +WORKDIR /angular-react-starter/ COPY nginx.conf /etc/nginx/nginx.conf COPY /angular/dist/angular-starter /var/www/html From 2a861f174f63cc59f733d59694b00359e02c57fa Mon Sep 17 00:00:00 2001 From: m1sse Date: Thu, 14 Jul 2022 01:20:49 +0700 Subject: [PATCH 28/29] 8 --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 91f36393d..cb95d40b4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,9 +3,9 @@ FROM nginx:alpine RUN chown -R nginx:nginx /var/log/nginx \ && chown -R nginx:nginx /etc/nginx/nginx.conf -WORKDIR /angular-react-starter/ + COPY nginx.conf /etc/nginx/nginx.conf -COPY /angular/dist/angular-starter /var/www/html +COPY ./angular/dist/angular-starter /var/www/html EXPOSE 80 From 5faac0f06be216849806c1b90f76a94380a132f5 Mon Sep 17 00:00:00 2001 From: m1sse Date: Thu, 14 Jul 2022 01:36:21 +0700 Subject: [PATCH 29/29] first commit --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index ac7c21c25..80a963b20 100644 --- a/README.md +++ b/README.md @@ -162,3 +162,4 @@ Here is a step by step Tutorial : https://www.ganatan.com/tutorials/getting-sta - Installation - https://www.ganatan.com/tutorials/demarrer-avec-angular - Tutoriels Etape par étape - https://www.ganatan.com/tutorials +"# angular-react-starter-ex"