Skip to content

Commit

Permalink
Fix publishing to github pages (#710)
Browse files Browse the repository at this point in the history
* Fix publishing to github pages

* Test

* Test

* Test

* Tweak

* a

* Tweak

* Tweak

* Tweak

* Tweak

* Tweak

* Tweak

* Final
  • Loading branch information
wjthieme authored Jan 31, 2025
1 parent aa51e11 commit 10bbf32
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .github/actions/push/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,23 @@ runs:
run: |
git config --global user.name "${{ inputs.user }}"
git config --global user.email "${{ inputs.user }}@users.noreply.github.com"
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
shell: bash
- name: Git Commit
if: ${{ inputs.message != '' }}
run: |
git add .
git commit -m "${{ inputs.message }}"
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
shell: bash
- name: Push Changes
run: |
git push origin ${{ inputs.branch }}
if [ ${{ inputs.tags }} = 'true' ]; then
git push --tags
fi
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
shell: bash
26 changes: 26 additions & 0 deletions .github/actions/ssh/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: 'SSH'
description: 'Setup ssh key.'

branding:
icon: key
color: green

inputs:
ssh-key:
description: 'SSH key'
required: true

runs:
using: "composite"
steps:
- name: Add SSH key
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: |
mkdir -p /home/runner/.ssh
ssh-keyscan github.com >> /home/runner/.ssh/known_hosts
echo "${{ inputs.ssh-key }}" > /home/runner/.ssh/github_actions
chmod 600 /home/runner/.ssh/github_actions
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
ssh-add /home/runner/.ssh/github_actions
shell: bash
2 changes: 2 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,5 @@ jobs:
run: yarn install
- name: Check changesets
run: yarn changeset status --since origin/main


11 changes: 6 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ jobs:
uses: actions/checkout@v4
with:
ssh-key: ${{ secrets.GH_DEPLOY_KEY }}
- name: Configure Git
run: |
git remote set-url origin ssh://[email protected]/${{ github.repository }}
git clone --depth 1 ssh://[email protected]/${{ github.repository }} abc
git clone --depth 1 [email protected]/${{ github.repository }} xyz
persist-credentials: false
- name: Setup SSH
uses: ./.github/actions/ssh
with:
ssh-key: ${{ secrets.GH_DEPLOY_KEY }}
- name: Setup Anchor
uses: ./.github/actions/anchor
- name: Install dependencies
Expand All @@ -36,6 +36,7 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_TOKEN }}
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
- name: Tag Release
run: yarn changeset tag
- name: Push Changes
Expand Down

0 comments on commit 10bbf32

Please sign in to comment.