From cee3bc3a2944fc28d11b0b486c5ea77c1a9725aa Mon Sep 17 00:00:00 2001 From: cradle8810 Date: Mon, 22 Apr 2024 04:20:26 +0900 Subject: [PATCH 1/4] Rename and replaced output style --- .github/workflows/deploy.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..35980eb --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,30 @@ +--- +name: Deployment + +on: + push: + branches: + - 'master' + +jobs: + Sitemap_txt: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: find html files and output as sitemap.txt + run: > + find . -type f -name "*.html" | + sed 's#\.\/#http:\/\/hayaworld\.net/#g' | + sed 's#\/www##g' + > www/sitemap.txt + + - name: View sitemap.txt + run: cat "www/sitemap.txt" + + - name: Upload sitemap.txt as artifacts + uses: actions/upload-artifact@v4 + with: + name: sitemap.txt + path: www/sitemap.txt From 7b3858244fde05e9fadfdc2cb5eeb5585a6752b2 Mon Sep 17 00:00:00 2001 From: cradle8810 Date: Mon, 22 Apr 2024 04:26:26 +0900 Subject: [PATCH 2/4] Convined into one workflow file --- .github/workflows/deploy.yml | 30 ------------------- .github/workflows/lints.yml | 20 ------------- .../workflows/{sitemap.yml => workflows.yml} | 28 +++++++++++++++-- 3 files changed, 25 insertions(+), 53 deletions(-) delete mode 100644 .github/workflows/deploy.yml delete mode 100644 .github/workflows/lints.yml rename .github/workflows/{sitemap.yml => workflows.yml} (53%) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index 35980eb..0000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,30 +0,0 @@ ---- -name: Deployment - -on: - push: - branches: - - 'master' - -jobs: - Sitemap_txt: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: find html files and output as sitemap.txt - run: > - find . -type f -name "*.html" | - sed 's#\.\/#http:\/\/hayaworld\.net/#g' | - sed 's#\/www##g' - > www/sitemap.txt - - - name: View sitemap.txt - run: cat "www/sitemap.txt" - - - name: Upload sitemap.txt as artifacts - uses: actions/upload-artifact@v4 - with: - name: sitemap.txt - path: www/sitemap.txt diff --git a/.github/workflows/lints.yml b/.github/workflows/lints.yml deleted file mode 100644 index 3481d68..0000000 --- a/.github/workflows/lints.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- -name: HTML Lints - -on: - push: - branches: - - '**' - -jobs: - HTML_Lint: - runs-on: ubuntu-latest - container: - image: ghcr.io/cradle8810/htmllint:latest - steps: - - - name: Checkout - uses: actions/checkout@v3 - - - name: Execute HTMLlint - run: htmllint diff --git a/.github/workflows/sitemap.yml b/.github/workflows/workflows.yml similarity index 53% rename from .github/workflows/sitemap.yml rename to .github/workflows/workflows.yml index 3f8dcb8..3a647a6 100644 --- a/.github/workflows/sitemap.yml +++ b/.github/workflows/workflows.yml @@ -1,12 +1,24 @@ --- -name: Make sitemap.txt +name: HTML Lints on: push: branches: - - 'master' - + - '**' + jobs: + HTML_Lint: + runs-on: ubuntu-latest + container: + image: ghcr.io/cradle8810/htmllint:latest + steps: + + - name: Checkout + uses: actions/checkout@v3 + + - name: Execute HTMLlint + run: htmllint + Sitemap_txt: runs-on: ubuntu-latest steps: @@ -28,3 +40,13 @@ jobs: with: name: sitemap.txt path: www/sitemap.txt + + Deployment: + needs: + - HTML_Lint + - Sitemap_txt + if: (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/auto_deploy') + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 From b9abe234a5f13d9da60f632ebc0608f642682cee Mon Sep 17 00:00:00 2001 From: cradle8810 Date: Mon, 22 Apr 2024 05:01:25 +0900 Subject: [PATCH 3/4] STG upload mechanism --- .github/workflows/workflows.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/workflows.yml b/.github/workflows/workflows.yml index 3a647a6..bc22638 100644 --- a/.github/workflows/workflows.yml +++ b/.github/workflows/workflows.yml @@ -41,12 +41,21 @@ jobs: name: sitemap.txt path: www/sitemap.txt - Deployment: + Deployment_STG: needs: - HTML_Lint - Sitemap_txt - if: (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/auto_deploy') + runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 + + - name: Upload to STG + uses: SamKirkland/FTP-Deploy-Action@v4.3.4 + with: + server: ${{ secrets.FTP_SRV }} + username: ${{ secrets.FTP_USERNAME }} + password: ${{ secrets.FTP_PASSWORD }} + server-dir: ${{ secrets.FTP_STG_DIR }}/ + local-dir: www/ From 217e6ab506cfe5c5f7ed280d69cc60129aff9ad8 Mon Sep 17 00:00:00 2001 From: cradle8810 Date: Mon, 22 Apr 2024 05:19:21 +0900 Subject: [PATCH 4/4] Add push to PRD workflows --- .github/workflows/PRD_build.yml | 21 +++++++++++++++++++++ .github/workflows/workflows.yml | 4 ++-- 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/PRD_build.yml diff --git a/.github/workflows/PRD_build.yml b/.github/workflows/PRD_build.yml new file mode 100644 index 0000000..939d6ee --- /dev/null +++ b/.github/workflows/PRD_build.yml @@ -0,0 +1,21 @@ +--- +name: PRD Push + +on: + workflow_dispatch: + +jobs: + Deployment_PRD: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Upload to PRD + uses: SamKirkland/FTP-Deploy-Action@v4.3.5 + with: + server: ${{ secrets.FTP_SRV }} + username: ${{ secrets.FTP_USERNAME }} + password: ${{ secrets.FTP_PASSWORD }} + server-dir: ${{ secrets.FTP_PRD_DIR }}/ + local-dir: www/ diff --git a/.github/workflows/workflows.yml b/.github/workflows/workflows.yml index bc22638..61acda9 100644 --- a/.github/workflows/workflows.yml +++ b/.github/workflows/workflows.yml @@ -1,5 +1,5 @@ --- -name: HTML Lints +name: Lints and STG upload on: push: @@ -52,7 +52,7 @@ jobs: uses: actions/checkout@v4 - name: Upload to STG - uses: SamKirkland/FTP-Deploy-Action@v4.3.4 + uses: SamKirkland/FTP-Deploy-Action@v4.3.5 with: server: ${{ secrets.FTP_SRV }} username: ${{ secrets.FTP_USERNAME }}