From 8910f58072b6a10f21f7b385a677ab9bd30b6765 Mon Sep 17 00:00:00 2001 From: BachErik Date: Sat, 6 Jul 2024 20:12:40 +0200 Subject: [PATCH] fix: github pages --- .github/workflows/deploy.yml | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 81e084d..febe314 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,9 +1,18 @@ name: Deploy to GitHub Pages on: - push: - branches: - - main # oder der Name deines Hauptbranches + # 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] + # Allows you to run this workflow manually from the Actions tab on GitHub. + workflow_dispatch: + +# Allow this job to clone the repo and create a page deployment +permissions: + contents: read + pages: write + id-token: write jobs: build-and-deploy: @@ -20,8 +29,13 @@ jobs: - name: Build Go project run: go build -o ./server ./main.go + deploy: + runs-on: ubuntu-latest + needs: build-and-deploy + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: - name: Deploy to GitHub Pages - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./ # Das Verzeichnis, das die ausführbare Datei enthält + id: deployment + uses: actions/deploy-pages@v1 \ No newline at end of file