Skip to content

Commit

Permalink
Add deploy workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
prasmussen committed Aug 28, 2022
1 parent 51c8b36 commit a2cabdb
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/deploy_cloudflare_release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
on:
push:
branches:
- release

env:
PROJECT_NAME: 7guis
WASM_PACK_URL: https://github.com/rustwasm/wasm-pack/releases/download/v0.10.3/wasm-pack-v0.10.3-x86_64-unknown-linux-musl.tar.gz
POLYESTER_CLI_URL: https://github.com/polyester-web/polyester-cli/releases/download/0.1.0-alpha4/poly_linux-x64.tar.gz

jobs:
deploy:
runs-on: ubuntu-latest
name: Deploy
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install node
uses: actions/setup-node@v3
with:
node-version: 16

- name: Install wasm-pack
run: |
mkdir -p ${HOME}/bin
wget --quiet -O wasm-pack.tar.gz $WASM_PACK_URL
tar -zxf wasm-pack.tar.gz --directory ${HOME}/bin --strip 1 --no-anchored --wildcards wasm-pack
rm wasm-pack.tar.gz
- name: Install polyester-cli
run: |
mkdir -p ${HOME}/bin
wget --quiet -O poly.tar.gz $POLYESTER_CLI_URL
tar -zxf poly.tar.gz --directory ${HOME}/bin poly
rm poly.tar.gz
- name: Build project
run: |
PATH="${PATH}:${HOME}/bin" poly build --release --hash-assets --script post_build.sh
- name: Publish
uses: cloudflare/wrangler-action@2.0.0
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}
command: pages publish dist --branch release --project-name=${{ env.PROJECT_NAME }}

0 comments on commit a2cabdb

Please sign in to comment.