From 7530bdfbb8370e4ed7dda8c4f95d4ae1ce28ab56 Mon Sep 17 00:00:00 2001 From: Abhiraj Roy <157954129+iconized@users.noreply.github.com> Date: Fri, 7 Jun 2024 05:36:27 +0530 Subject: [PATCH] :construction_worker: ci(deployment): changes the cd Signed-off-by: Abhiraj Roy <157954129+iconized@users.noreply.github.com> --- .github/workflows/deployment.yml | 88 ++++++++++---------------------- 1 file changed, 26 insertions(+), 62 deletions(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index d8e68419..492c3f9e 100755 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -1,77 +1,41 @@ -# Sample workflow for building and deploying a Hugo site to GitHub Pages -name: Deploy Snigdha OS - +# https://github.com/actions/deploy-pages#usage +name: Deploy to GitHub Pages on: - # Runs on pushes targeting the default branch + workflow_dispatch: push: - branches: ["master"] - pull_request: - branches: ["master"] - -# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages -permissions: - contents: read - pages: write - id-token: write - -# Environment variables available to all jobs and steps in this workflow -env: - HUGO_ENV: production - HUGO_VERSION: "0.121.2" - GO_VERSION: "1.20.5" - NODE_VERSION: "20.0.0" - TINA_CLIENT_ID: ${{ vars.TINA_CLIENT_ID }} - TINA_TOKEN: ${{ vars.TINA_TOKEN }} - + branches: + - master jobs: - # Build job build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - name: Set up Node.js - uses: actions/setup-node@v4 + - uses: actions/checkout@v3 + - run: corepack enable + - uses: actions/setup-node@v3 with: - node-version: ${{ env.NODE_VERSION }} - - - name: Install Hugo - run: | - curl -LO "https://github.com/gohugoio/hugo/releases/download/v${{ env.HUGO_VERSION }}/hugo_extended_${{ env.HUGO_VERSION }}_Linux-64bit.tar.gz" - tar -xvf hugo_extended_${{ env.HUGO_VERSION }}_Linux-64bit.tar.gz - sudo mv hugo /usr/local/bin/ - rm hugo_extended_${{ env.HUGO_VERSION }}_Linux-64bit.tar.gz - hugo version - - - name: Install Go - run: | - curl -LO "https://dl.google.com/go/go${{ env.GO_VERSION }}.linux-amd64.tar.gz" - sudo tar -C /usr/local -xzf go${{ env.GO_VERSION }}.linux-amd64.tar.gz - echo "export PATH=$PATH:/usr/local/go/bin" >> $GITHUB_ENV - rm go${{ env.GO_VERSION }}.linux-amd64.tar.gz - go version - - - name: Setup Project - run: npm run project-setup - - - name: Install npm dependencies - run: npm install - - - name: Publish to GitHub Pages - run: npm run build - + node-version: "16" + # Pick your own package manager and build script + - run: npm install + - run: npx nuxt build --preset github_pages - name: Upload artifact - uses: actions/upload-pages-artifact@v3 + uses: actions/upload-pages-artifact@v1 with: - path: ./public - + path: ./.output/public # Deployment job deploy: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest + # Add a dependency to the build job needs: build + # Grant GITHUB_TOKEN the permissions required to make a Pages deployment + permissions: + pages: write # to deploy to Pages + id-token: write # to verify the deployment originates from an appropriate source + # Deploy to the github_pages environment + environment: + name: github_pages + url: ${{ steps.deployment.outputs.page_url }} + # Specify runner + deployment step + runs-on: ubuntu-latest steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v4 + uses: actions/deploy-pages@v1