From 37e76b968ce3ae1f46d5f5e26998caa6e8c53eaf Mon Sep 17 00:00:00 2001 From: Dmytro Ovchynnikov Date: Mon, 4 Nov 2024 22:48:08 +0200 Subject: [PATCH] modify pipeline --- .github/workflows/hugo-ci-workflow.yml | 44 -------------------------- .github/workflows/pdf-stage.yml | 30 ++++++++++++++++++ 2 files changed, 30 insertions(+), 44 deletions(-) delete mode 100644 .github/workflows/hugo-ci-workflow.yml create mode 100644 .github/workflows/pdf-stage.yml diff --git a/.github/workflows/hugo-ci-workflow.yml b/.github/workflows/hugo-ci-workflow.yml deleted file mode 100644 index 9f11be4a5..000000000 --- a/.github/workflows/hugo-ci-workflow.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Hugo-CI -on: - push: - branches: - - develop - paths-ignore: - '.github/**' -jobs: - job-one: - name: Deploy - runs-on: [self-hosted, linux, x64, dev4-pdf] - steps: - - name: Hugo build - run: | - sudo rm -rf aspose-pdf-docs - mkdir aspose-pdf-docs && cd aspose-pdf-docs - git clone --depth 1 --single-branch --branch master https://git.dev.dynabic.com/containerize-hugo/lutsk-aspose-prototype.git - git clone --depth 1 --single-branch --branch master https://git.dev.dynabic.com/containerize-hugo/lutsk-aspose-theme.git lutsk-aspose-prototype/themes/lutsk-aspose-theme - git clone --depth 1 --single-branch --branch develop https://github.com/aspose-pdf/Aspose.PDF-Documentation.git lutsk-aspose-prototype/content/ - cd lutsk-aspose-prototype - sudo npm install -D --save autoprefixer - sudo npm install -D --save postcss-cli - sudo apt install jq -y - rm -rf public - hugo --minify --baseURL https://docs-qa.aspose.com/pdf - - - name: AWS credentials - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: us-west-2 - - - name: Deploy to S3 - run: aws s3 sync --quiet aspose-pdf-docs/lutsk-aspose-prototype/public/ s3://docs-qa.aspose.com/pdf/ - - - name: Invalidate CloudFront - uses: chetan/invalidate-cloudfront-action@v2 - env: - PATHS: '/pdf/*' - AWS_REGION: 'us-west-2' - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - DISTRIBUTION: ${{ secrets.DISTRIBUTION }} diff --git a/.github/workflows/pdf-stage.yml b/.github/workflows/pdf-stage.yml new file mode 100644 index 000000000..a2eab3f23 --- /dev/null +++ b/.github/workflows/pdf-stage.yml @@ -0,0 +1,30 @@ +name: Hugo-CI +on: + push: + branches: + - develop + +jobs: + job-one: + name: Deploy + runs-on: [self-hosted, linux, x64, dev4-pdf] + steps: + - name: hugo build + run: | + git clone https://x-access-token:${{ secrets.GH_PAT }}@github.com/aspose-pdf/Aspose.PDF-Hugo-template.git + cd Aspose.PDF-Hugo-template && ls -l + sudo npm install -D --save autoprefixer + sudo npm install -D --save postcss-cli + rsync --recursive --delete --force --progress ../* content/ + rm -rf public + hugo --baseURL docs-qa.aspose.com/pdf --config ./config.toml;./configs/docs-qa.aspose.com-pdf.toml + + - name: Configure AWS credential + uses: aws-actions/configure-aws-credentials@v3 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: us-west-2 + + - name: Deploy static site to S3 bucket + run: aws s3 sync ./public/ s3://docs-qa.aspose.com/pdf --delete