diff --git a/.gitea/workflows/pipeline-test.yaml b/.gitea/workflows/pipeline-test.yaml index a9bd7ae..870acc2 100644 --- a/.gitea/workflows/pipeline-test.yaml +++ b/.gitea/workflows/pipeline-test.yaml @@ -1,4 +1,4 @@ -name: Build and Deploy Hugo Site +name: Build Hugo Site on: push: @@ -8,6 +8,7 @@ on: jobs: build: runs-on: ubuntu-latest + steps: - uses: actions/checkout@v2.4.0 @@ -28,7 +29,7 @@ jobs: uses: actions/setup-node@v4.0.2 with: node-version: '20' - cache: 'npm' + cache: 'npm' # caching npm dependencies - name: Cache Node modules uses: actions/cache@v3 @@ -47,33 +48,27 @@ jobs: uses: peaceiris/actions-hugo@v3.0.0 with: hugo-version: '0.121.2' - extended: true + 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- - name: Build Hugo site run: hugo --minify - - 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 + - name: test deployment via FTP uses: SamKirkland/FTP-Deploy-Action@4.0.0 with: - protocol: ftps + protocol: ftps # Ensure to use FTPS server: ${{ secrets.FTP_SERVER }} username: ${{ secrets.FTP_USERNAME }} password: ${{ secrets.FTP_PASSWORD }} - local-dir: public/ + local-dir: 'public/' server-dir: '/' diff --git a/amplify.yml b/amplify.yml new file mode 100644 index 0000000..76d375a --- /dev/null +++ b/amplify.yml @@ -0,0 +1,29 @@ +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/**/*