From bfb73d889688b6fb24e2df66c3899d11f36e8502 Mon Sep 17 00:00:00 2001 From: Kevin Schneider Date: Thu, 10 Oct 2024 09:35:59 +0200 Subject: [PATCH] update deploy action --- .github/workflows/deploy.yml | 86 ++++++++--------------- .github/workflows/update-dependencies.yml | 51 -------------- 2 files changed, 31 insertions(+), 106 deletions(-) delete mode 100644 .github/workflows/update-dependencies.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 9a9addd0..979b6df7 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,63 +1,39 @@ -name: deploy-gh-pages +name: Deploy to GitHub Pages on: - # Triggers the workflow on push or pull request events but only for the "main" branch + # Trigger the workflow every time you push to the `main` branch + # Using a different branch name? Replace `main` with your branch’s name push: - branches: [ "main" ] - - # triggers when "update-dependencies" is completed - workflow_run: - workflows: [update-dependencies] - types: [completed] - - # Allows you to run this workflow manually from the Actions tab + branches: [ main ] + # Allows you to run this workflow manually from the Actions tab on GitHub. workflow_dispatch: -# A workflow run is made up of one or more jobs that can run sequentially or in parallel +# Allow this job to clone the repo and create a page deployment +permissions: + contents: read + pages: write + id-token: write + jobs: - # This workflow contains a single job called "build" - build-and-deploy: - # The type of runner that the job will run on + build: runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - name: Checkout - uses: actions/checkout@v3 - - - name: Setup .NET 3.1 - uses: actions/setup-dotnet@v3 - with: - dotnet-version: 3.1.301 - - - name: Setup .NET 5 - uses: actions/setup-dotnet@v3 - with: - dotnet-version: 5.0.102 - - - name: Setup node & sass - uses: actions/setup-node@v3 - with: - node-version: '16' - - - name: install sass - run: npm install -g sass - - - name: install node modules - run: npm install - - - name: Restore dotnet tools - run: dotnet tool restore - - - name: Build - working-directory: ./src - run: dotnet fornax build - - - name: deploy - uses: JamesIves/github-pages-deploy-action@v4 - with: - TOKEN: ${{ secrets.GITHUB_TOKEN }} - BRANCH: gh-pages # The branch the action should deploy to. - FOLDER: ./src/_public # The folder the action should deploy. - CLEAN: true # Automatically remove deleted files from the deploy branch \ No newline at end of file + - name: Checkout your repository using git + uses: actions/checkout@v4 + - name: Install, build, and upload your site + uses: withastro/action@v3 + # with: + # path: . # The root location of your Astro project inside the repository. (optional) + # node-version: 20 # The specific version of Node that should be used to build your site. Defaults to 20. (optional) + # package-manager: pnpm@latest # The Node package manager that should be used to install dependencies and build your site. Automatically detected based on your lockfile. (optional) + + deploy: + needs: build + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 \ No newline at end of file diff --git a/.github/workflows/update-dependencies.yml b/.github/workflows/update-dependencies.yml deleted file mode 100644 index f75f4095..00000000 --- a/.github/workflows/update-dependencies.yml +++ /dev/null @@ -1,51 +0,0 @@ -# This is a basic workflow to help you get started with Actions - -name: update-dependencies - -# Controls when the workflow will run -on: - # Triggers the workflow at 20pm thursday (depends on timezone) (0 18 * * THU) - schedule: - - cron: '0 21 * * THU' - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - # This workflow contains a single job called "build" - update_dependencies: - # The type of runner that the job will run on - runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - name: Checkout - uses: actions/checkout@v3 - - - name: Setup .NET 3.1 - uses: actions/setup-dotnet@v3 - with: - dotnet-version: 3.1.301 - - - name: Setup .NET 5 - uses: actions/setup-dotnet@v3 - with: - dotnet-version: 5.0.102 - - - name: Setup Node.js environment - uses: actions/setup-node@v3 - with: - node-version: 16 - - - name: Install rollup - run: npm install --global rollup@3.1.0 - - - name: Update to latest nfdi4plants web components - run: npm run updatecomponents - - - name: Commit and push changes - uses: stefanzweifel/git-auto-commit-action@v4 - with: - commit_message: Update @nfdi4plants/web-components ⬆️