diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml new file mode 100644 index 0000000..ddc5577 --- /dev/null +++ b/.github/workflows/deploy.yaml @@ -0,0 +1,30 @@ +on: + push: + tags: + - '*' + - '!v1' + +jobs: + deploy: + name: Deploy + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + - name: Build latest dist/ folder + run: | + npm install -g pnpm + pnpm install --frozen-lockfile + pnpm run build + - name: Upload dist/ folder + run: | + git config --global user.email "<41898282+github-actions[bot]@users.noreply.github.com>" + git config --global user.name "github-actions[bot]" + git rm -rf . + git clean -fdx + git reset --hard + git checkout --orphan v1 + git add dist README.md LICENSE action.yaml + git commit -m "chore: create v1 release ($GITHUB_SHA)" + git tag --force v1 + git push -f --tags origin v1 diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 07d51d3..afa9cd8 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -21,17 +21,17 @@ jobs: git config --global user.email "<41898282+github-actions[bot]@users.noreply.github.com>" git config --global user.name "github-actions[bot]" - git checkout --orphan test + git checkout --orphan ci git add dist git commit -m "chore: update dist folder ($GITHUB_SHA)" - git push -f origin test + git push -f origin ci test: name: Test runs-on: ubuntu-latest needs: build steps: - name: Setup tale/kubectl-action - uses: tale/kubectl-action@test + uses: tale/kubectl-action@ci with: base64-kube-config: ${{ secrets.KUBE_CONFIG }} - name: Test the output of `kubectl cluster-info` diff --git a/package.json b/package.json index c273989..6552a26 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "scripts": { "dev": "ncc -smw --license licenses.txt build src/main.ts", "build": "ncc -sm --license licenses.txt build src/main.ts", - "push": "np --no-cleanup --no-publish --no-tests --message 'chore: v%s' && git tag --force v1 && git push -f --tags", + "push": "np --no-cleanup --no-publish --no-tests --message 'chore: v%s'", "version": "pnpm run build && git add dist" }, "dependencies": {