From 3a41709d1cf0c18ccf0e9aa760579f3f5beb9fac Mon Sep 17 00:00:00 2001 From: Andreas Hnida Date: Wed, 17 Apr 2024 13:01:27 +0200 Subject: [PATCH 1/2] deleted --- amplify.yml | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 amplify.yml diff --git a/amplify.yml b/amplify.yml deleted file mode 100644 index 76d375a..0000000 --- a/amplify.yml +++ /dev/null @@ -1,29 +0,0 @@ -version: 1 -frontend: - phases: - preBuild: - commands: - - yum install -y curl - - curl -LO "https://github.com/gohugoio/hugo/releases/download/v0.121.2/hugo_extended_0.121.2_Linux-64bit.tar.gz" - - tar -xvf hugo_extended_0.121.2_Linux-64bit.tar.gz - - mv hugo /usr/local/bin/ - - rm hugo_extended_0.121.2_Linux-64bit.tar.gz - - echo "HUGO 0.121.2 INSTALLED" - - curl -LO "https://dl.google.com/go/go1.20.5.linux-amd64.tar.gz" - - tar -C /usr/local -xzf go1.20.5.linux-amd64.tar.gz - - export PATH=$PATH:/usr/local/go/bin - - rm go1.20.5.linux-amd64.tar.gz - - echo "GO 1.20.5 INSTALLED" - - npm install - build: - commands: - - npm run project-setup - - npm run build - artifacts: - # IMPORTANT - Please verify your build output directory - baseDirectory: /public - files: - - "**/*" - cache: - paths: - - node_modules/**/* From 17569bdcd4d095476bde9dfdcfdff329bb3d8e98 Mon Sep 17 00:00:00 2001 From: Andreas Hnida Date: Wed, 17 Apr 2024 13:01:58 +0200 Subject: [PATCH 2/2] split workflow into build and deploy --- .gitea/workflows/pipeline-test.yaml | 39 ++++++++++++++++------------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/.gitea/workflows/pipeline-test.yaml b/.gitea/workflows/pipeline-test.yaml index 870acc2..a9bd7ae 100644 --- a/.gitea/workflows/pipeline-test.yaml +++ b/.gitea/workflows/pipeline-test.yaml @@ -1,4 +1,4 @@ -name: Build Hugo Site +name: Build and Deploy Hugo Site on: push: @@ -8,7 +8,6 @@ on: jobs: build: runs-on: ubuntu-latest - steps: - uses: actions/checkout@v2.4.0 @@ -29,7 +28,7 @@ jobs: uses: actions/setup-node@v4.0.2 with: node-version: '20' - cache: 'npm' # caching npm dependencies + cache: 'npm' - name: Cache Node modules uses: actions/cache@v3 @@ -48,27 +47,33 @@ jobs: uses: peaceiris/actions-hugo@v3.0.0 with: hugo-version: '0.121.2' - extended: true # Specify to use Hugo Extended version - - - name: Cache Hugo modules - uses: actions/cache@v3 - with: - path: | - resources - public - key: ${{ runner.os }}-hugo-${{ hashFiles('**/go.sum', '**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-hugo- + extended: true - name: Build Hugo site run: hugo --minify - - name: test deployment via FTP + - name: Upload Artifacts + uses: actions/upload-artifact@v2 + with: + name: hugo-site + path: public/ + + deploy: + needs: build + runs-on: ubuntu-latest + steps: + - name: Download Artifacts + uses: actions/download-artifact@v2 + with: + name: hugo-site + path: public + + - name: Deploy to Server uses: SamKirkland/FTP-Deploy-Action@4.0.0 with: - protocol: ftps # Ensure to use FTPS + protocol: ftps server: ${{ secrets.FTP_SERVER }} username: ${{ secrets.FTP_USERNAME }} password: ${{ secrets.FTP_PASSWORD }} - local-dir: 'public/' + local-dir: public/ server-dir: '/'