Skip to content

Commit

Permalink
let's see if we can deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
nonrational committed Oct 24, 2024
1 parent 8a2f768 commit 5ee8178
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 16 deletions.
43 changes: 27 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,35 @@ jobs:
- run: deno fmt --check
- run: deno lint

# deploy:
# runs-on: ubuntu-latest
# if: github.repository_owner == 'nonrational'
deploy:
runs-on: ubuntu-latest
needs: test

steps:
- name: Clone repository
uses: actions/checkout@v4

- name: Install Deno
uses: denoland/setup-deno@v2
with:
deno-version: v2.x

# steps:
# - name: Clone repository
# uses: actions/checkout@v4
- name: Install deployctl
run: deno install -gArf jsr:@deno/deployctl

# - name: Install Deno
# uses: denoland/setup-deno@v2
# with:
# deno-version: v2.x
- name: Add CANIUSE_AS_OF_EPOCH to .env
run:

# - name: Add CANIUSE_AS_OF_EPOCH to .env
# run: deno scripts/print-as-of-env.ts | tee -a .env
- name: Build _fresh/
run: |
deno scripts/print-as-of-env.ts | tee -a .env
deno task build
# - name: Build step
# run: 'deno task build'
- name: Deploy to Preview
run: deployctl deploy
if: github.ref != 'refs/tags/prod'

# - run: deno install -gArf jsr:@deno/deployctl
# - run: deployctl deploy --entrypoint=./main.ts
# If we're building a thing that's called prod
- name: Deploy to Production
run: deployctl deploy --prod
if: github.ref == 'refs/tags/prod'
15 changes: 15 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,18 @@ deploy-preview: build
build:
deno task build

tag-prod: check-repo whats-going-to-prod
git push origin :refs/tags/prod
git tag -f prod demo
git push origin prod

whats-going-to-prod:
@git fetch -f --tags origin
@echo "$$(git log --pretty=format:"%h}<%aN>}%s" prod..main)\n" | cut -c-120 | column -s '}' -t
@read -p"Press [Enter] to continue, ^C to abort..." _

check-repo:
@test $(BRANCH) = main || (echo "You are not in the main branch" && exit 1)
@git pull --ff-only origin HEAD
@test $(shell git rev-parse origin/HEAD) = $(shell git rev-parse HEAD) || (echo "You have commits that have not been pushed" && exit 1)
@test -z "$(shell git status -s)" || (echo "You have uncommited changes in this branch" && exit 1)

0 comments on commit 5ee8178

Please sign in to comment.