From f45c3af8ee581efb5cda10b1ee6e5a0ba684ce08 Mon Sep 17 00:00:00 2001 From: Junya Okabe Date: Tue, 3 Oct 2023 00:16:30 +0900 Subject: [PATCH] add: deploy.yml --- .github/workflows/deploy.yml | 42 ++++++++++++++++++++++++++++++++++++ 1 file changed, 42 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..d769655 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,42 @@ +name: check dist is up to date +on: + pull_request: + branches: + - main + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: checkout repo + uses: actions/checkout@v3 + + - name: setup node + uses: actions/setup-node@v3 + with: + node-version: '20' + + - name: install dependencies + run: yarn install --frozen-lockfile + + - name: rebuild + run: yarn build + + - name: compare dist + run: | + if [ "$(git diff --ignore-space-at-eol ./dist | wc -l)" -gt "0" ]; then + echo "dist is not up to date" + git diff + exit 1 + fi + id: diff + + - name: upload artifact + if: ${{ steps.diff.outputs.exit_code == '1' }} + uses: actions/upload-artifact@v3 + with: + name: dist + path: dist