Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add github action to deploy to cloudflare pages #7

Merged
merged 39 commits into from
Nov 19, 2024
Merged
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
3cd69c7
ci: deploy to cloudflare pages automatically
hydrobeam Nov 19, 2024
6ddaaaf
cleanup hyphens
hydrobeam Nov 19, 2024
4dc4290
idk
hydrobeam Nov 19, 2024
f51d830
fixed
hydrobeam Nov 19, 2024
fe387ae
try it
hydrobeam Nov 19, 2024
743feba
try to make branch go
hydrobeam Nov 19, 2024
d4ff612
add comment
hydrobeam Nov 19, 2024
c45d72f
clean up properly
hydrobeam Nov 19, 2024
4b21004
work it
hydrobeam Nov 19, 2024
a501b8f
change name
hydrobeam Nov 19, 2024
15b870c
append url
hydrobeam Nov 19, 2024
154d74e
switch to deprecated action
hydrobeam Nov 19, 2024
4e27131
cloudflared
hydrobeam Nov 19, 2024
612bd2d
use proper syntax
hydrobeam Nov 19, 2024
3902df6
ref name
hydrobeam Nov 19, 2024
6384c25
lethimcook
hydrobeam Nov 19, 2024
3a40317
trythis
hydrobeam Nov 19, 2024
45c6964
back to back
hydrobeam Nov 19, 2024
ac0fbf9
mosnter
hydrobeam Nov 19, 2024
1c653a5
indent i guess
hydrobeam Nov 19, 2024
5482430
nuke perms?
hydrobeam Nov 19, 2024
b9db996
nuke
hydrobeam Nov 19, 2024
1e4fd53
try stuff
hydrobeam Nov 19, 2024
e049d6b
idek
hydrobeam Nov 19, 2024
f45de37
try
hydrobeam Nov 19, 2024
9352050
fix
hydrobeam Nov 19, 2024
524f161
yolo
hydrobeam Nov 19, 2024
02b3354
yolo
hydrobeam Nov 19, 2024
9966ed3
fixup
hydrobeam Nov 19, 2024
1688a15
cscs
hydrobeam Nov 19, 2024
ff478da
yolo
hydrobeam Nov 19, 2024
54f4eb4
yip
hydrobeam Nov 19, 2024
b671d49
idfk
hydrobeam Nov 19, 2024
a73a7b4
try
hydrobeam Nov 19, 2024
2e08b5a
final attempt
hydrobeam Nov 19, 2024
001a11e
penultimate attempt
hydrobeam Nov 19, 2024
51cf47d
ehh
hydrobeam Nov 19, 2024
c4e13d8
cleanup emojis
hydrobeam Nov 19, 2024
921595a
bold not italic
hydrobeam Nov 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
mosnter
  • Loading branch information
hydrobeam committed Nov 19, 2024
commit ac0fbf97b0503751a487d18cbe93564ab99b3a17
19 changes: 10 additions & 9 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Set environment variables
run: |
# Short name for current branch. For PRs, use target branch (base ref)
GIT_BRANCH=${GITHUB_BASE_REF:-${GITHUB_REF#refs/heads/}}
echo "GIT_BRANCH=$GIT_BRANCH" >> $GITHUB_ENV
- name: Get Head Commit Message
id: get_head_commit_message
run: echo "HEAD_COMMIT_MESSAGE=$(git show -s --format=%s)" >> "$GITHUB_OUTPUT"

- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch

# stolen from: https://github.com/cloudflare/pages-action/issues/16#issuecomment-1398478711
- name: Comment deploy start
Expand Down Expand Up @@ -66,13 +69,11 @@ jobs:

- name: Publish to Cloudflare
id: deploy
uses: cloudflare/pages-action@v1
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
directory: crates/org-wasm/dist
projectName: org-rust
# command: pages deploy --project-name=org-rust --branch actions
command: pages deploy crates/org-wasm/dist --project-name=org-rust --branch ${{ steps.extract_branch.outputs.branch }} --commit-hash ${{ github.sha }} --commit-message ${{ github.event.workflow_run.head_commit.message }}

- name: Comment deploy url
uses: mshick/add-pr-comment@v2
Expand Down