From abe0729045c55c6c8a02abae152e7fc3adfa3ec8 Mon Sep 17 00:00:00 2001 From: Tiago Ilieve Date: Sat, 14 Sep 2024 12:20:55 -0300 Subject: [PATCH] Add GitHub Actions deployment to Cloudflare Pages --- .github/workflows/deploy.yml | 18 ++++++++++++++++++ Makefile | 5 +++++ 2 files changed, 23 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..ec2c249 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,18 @@ +--- +name: Deploy +on: + - push +jobs: + deploy: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - name: Dependencies + run: | + npm ci + - name: Deploy + env: + BRANCH: ${{ github.REF_NAME }} + CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} + run: | + make deploy diff --git a/Makefile b/Makefile index 5c38c5c..5860e6c 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,11 @@ +BRANCH ?= staging + check: npx prettier --check functions/ +deploy: + npx wrangler pages deploy --branch $(BRANCH) --project-name myhro-info . + lint: DEBUG=eslint:cli-engine npx eslint --ext .js --ext .ts functions/