diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..080eb5a --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "npm" + directory: '/' + schedule: + interval: 'weekly' diff --git a/.github/workflows/pull_requests.yml b/.github/workflows/pull_requests.yml new file mode 100644 index 0000000..ca1af6e --- /dev/null +++ b/.github/workflows/pull_requests.yml @@ -0,0 +1,51 @@ +name: PR workflow +on: pull_request + +permissions: + pull-requests: write + contents: write + +jobs: + test-build: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [ 18.x ] + steps: + - name: Checkout 🛎️ + uses: actions/checkout@v2 + with: + persist-credentials: false + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - run: npm install -g gatsby-cli + - run: npm install -g flotiq-cli + - run: flotiq import . ${{ secrets.GATSBY_FLOTIQ_API_KEY }} + - run: yarn install + - run: gatsby build + env: + GATSBY_FLOTIQ_API_KEY: ${{ secrets.GATSBY_FLOTIQ_API_KEY }} + SNIPCART_API_KEY: 'test' + GA_MEASUREMENT_ID: '' + dependabot: + needs: test-build + runs-on: ubuntu-latest + if: github.actor == 'dependabot[bot]' + steps: + - name: Dependabot metadata + id: metadata + uses: dependabot/fetch-metadata@v1 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + - name: Approve a PR + run: gh pr review --approve "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GH_TOKEN: ${{secrets.GITHUB_TOKEN}} + - name: Enable auto-merge for Dependabot PRs + run: gh pr merge --auto --merge "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GH_TOKEN: ${{secrets.GITHUB_TOKEN}} \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/push.yml similarity index 85% rename from .github/workflows/test.yml rename to .github/workflows/push.yml index f2eda95..25480e1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/push.yml @@ -1,5 +1,10 @@ -name: test-build -on: push +name: Push workflow +on: + push: + branches: + - master + workflow_dispatch: + jobs: test: runs-on: ubuntu-latest @@ -23,4 +28,4 @@ jobs: env: GATSBY_FLOTIQ_API_KEY: ${{ secrets.GATSBY_FLOTIQ_API_KEY }} SNIPCART_API_KEY: 'test' - GA_MEASUREMENT_ID: '' + GA_MEASUREMENT_ID: '' \ No newline at end of file