From 4718d1b8498cf24a9ecf945ddbfba08a708d7d53 Mon Sep 17 00:00:00 2001 From: Martin Raifer Date: Fri, 22 Jul 2022 12:25:55 +0200 Subject: [PATCH] update and add workflow to automatically run `npm run build` --- .github/workflows/codespell.yml | 2 +- .github/workflows/deploy.yml | 38 +++++++++++++++++++++++++++++++++ .github/workflows/lint.yml | 6 +++--- .github/workflows/test.yml | 6 +++--- 4 files changed, 45 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml index b977a797..d2c248dc 100644 --- a/.github/workflows/codespell.yml +++ b/.github/workflows/codespell.yml @@ -8,7 +8,7 @@ jobs: name: Check for spelling errors runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: codespell-project/actions-codespell@master with: check_filenames: true diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 00000000..c61d3f76 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,38 @@ +name: Deploy + +permissions: + contents: write + +on: + push: + branches: + - main + +jobs: + deploy: + name: Deploy + runs-on: ubuntu-latest + if: "!contains(github.event.head_commit.message, 'Deploy') && github.repository == 'openstreetmap/id-tagging-schema'" + steps: + - name: Checkout + uses: actions/checkout@v3 # If you're using actions/checkout@v3 you must set persist-credentials to false in most cases for the deployment to work correctly. + with: + persist-credentials: false + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '18' + + - name: Install Node.js dependencies + run: npm install + + - name: Build + run: npm run build + + - name: Deploy 🚀 + uses: JamesIves/github-pages-deploy-action@v4.4.0 + with: + BRANCH: main # The branch the action should deploy to. + FOLDER: . # The folder the action should deploy. + CLEAN: false # Automatically remove deleted files from the deploy branch diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 974fbbdd..b7b64038 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -5,9 +5,9 @@ jobs: name: Check for code formatting mistakes runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 with: - node-version: '16' + node-version: '18' - run: npm install - run: npm run lint diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7b501113..57427d1a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,12 +15,12 @@ jobs: strategy: matrix: - node-version: [12.x, 14.x, 16.x] + node-version: ['18'] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - run: npm install