-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
74 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
name: Deploy | ||
name: Checks | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
|
@@ -17,41 +17,27 @@ env: | |
ACTIONS_RUNNER_DEBUG: true | ||
|
||
jobs: | ||
deploy: | ||
checks: | ||
runs-on: ['ubuntu-latest'] | ||
steps: | ||
- name: 🔑 Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: 🦀 Set up Rust | ||
run: | | ||
rustup set auto-self-update disable | ||
rustup toolchain install 1.81.0 --profile minimal | ||
rustup default 1.81.0 | ||
- name: Install Nix | ||
uses: cachix/install-nix-action@v30 | ||
|
||
- uses: Swatinem/[email protected] | ||
- name: Setup Cachix | ||
uses: cachix/cachix-action@v15 | ||
with: | ||
prefix-key: v0 # increment this to bust the cache if needed | ||
|
||
- name: Install sccache | ||
uses: mozilla-actions/[email protected] | ||
env: | ||
RUSTC_WRAPPER: 'sccache' | ||
SCCACHE_GHA_ENABLED: true | ||
name: 'devenv' | ||
|
||
- name: 🛠️ Build worker | ||
run: cargo install --quiet worker-build && worker-build --release | ||
- name: Install devenv.sh | ||
run: nix profile install nixpkgs#devenv | ||
|
||
- name: 🐰 Set up Bun | ||
uses: oven-sh/setup-bun@main | ||
with: | ||
bun-version: 'latest' | ||
|
||
- name: 🔸 Cloudflare Workers - Deploy | ||
env: | ||
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | ||
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | ||
- name: Lint | ||
run: | | ||
bun x wrangler@latest deploy \ | ||
--env='production' \ | ||
--config='wrangler.toml' | ||
fmt | ||
lint | ||
- name: Build | ||
run: build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: Deploy | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
env: | ||
NAME: 'url-shortener' | ||
CARGO_TERM_COLOR: 'always' | ||
ACTIONS_RUNNER_DEBUG: true | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ['ubuntu-latest'] | ||
steps: | ||
- name: 🔑 Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: 🦀 Set up Rust | ||
run: | | ||
rustup set auto-self-update disable | ||
rustup toolchain install 1.81.0 --profile minimal | ||
rustup default 1.81.0 | ||
- uses: Swatinem/[email protected] | ||
with: | ||
prefix-key: v0 # increment this to bust the cache if needed | ||
|
||
- name: Install sccache | ||
uses: mozilla-actions/[email protected] | ||
env: | ||
RUSTC_WRAPPER: 'sccache' | ||
SCCACHE_GHA_ENABLED: true | ||
|
||
- name: 🛠️ Build worker | ||
run: cargo install --quiet worker-build && worker-build --release | ||
|
||
- name: 🐰 Set up Bun | ||
uses: oven-sh/setup-bun@main | ||
with: | ||
bun-version: 'latest' | ||
|
||
- name: 🔸 Cloudflare Workers - Deploy | ||
env: | ||
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | ||
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | ||
run: | | ||
bun x wrangler@latest deploy \ | ||
--env='production' \ | ||
--config='wrangler.toml' |