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/