From 4dbbe44644c1216a0566144d0e5ac89a7d8dfa87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Jovan=C3=AD=20Gonz=C3=A1lez?= <12443324+drackp2m@users.noreply.github.com> Date: Sun, 3 Nov 2024 22:40:04 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20try=20to=20fix=20release?= =?UTF-8?q?=20on=20ci?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/gh-pages.yml | 5 ++-- .github/workflows/release.yml | 50 ++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index e24ff77b..d74a18bd 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -4,15 +4,16 @@ on: pull_request: branches: - main + types: [closed] permissions: - contents: write + contents: read pages: write id-token: write concurrency: group: 'pages' - cancel-in-progress: false + cancel-in-progress: true jobs: tests: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..f25d5eca --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,50 @@ +name: Deploy Play Set Online to Github Pages + +on: + push: + branches: + - main + +permissions: + contents: write + id-token: write + +concurrency: + group: 'release' + cancel-in-progress: true + +jobs: + release: + runs-on: ubuntu-latest + needs: build + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '22.9' + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Import GPG key + env: + GPG_PRIVATE_KEY: ${{ secrets.SEMANTIC_RELEASE_GPG_PRIVATE_KEY }} + run: | + echo "$GPG_PRIVATE_KEY" > private.key + gpg --batch --import private.key + git config --global user.name "drackp2m-semantic-release-bot" + git config --global user.email "187212958+drackp2m-semantic-release-bot@users.noreply.github.com" + git config --global commit.gpgSign true + git config --global user.signingkey 89AE9225AE159D89 + echo "allow-loopback-pinentry" >> ~/.gnupg/gpg-agent.conf + echo "pinentry-mode loopback" >> ~/.gnupg/gpg.conf + gpgconf --kill gpg-agent + + - name: Run semantic-release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: node --run release