Use correct NPM version in Actions
parent
1d9e46dbad
commit
c5cbdf5ae1
|
@ -7,35 +7,40 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Read .nvmrc
|
- name: Read Node.js & NPM versions
|
||||||
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
|
run: |
|
||||||
id: nvm
|
echo "##[set-output name=NODE;]$(cat package.json | jq -r '.engines.node')"
|
||||||
|
echo "##[set-output name=NPM;]$(cat package.json | jq -r '.engines.npm')"
|
||||||
|
id: versions
|
||||||
|
|
||||||
- name: Use Node.js (.nvmrc)
|
- name: Use correct Node.js version
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
node-version: "${{ steps.nvm.outputs.NVMRC }}"
|
node-version: "${{ steps.versions.outputs.NODE }}"
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Use correct NPM version
|
||||||
run: npm ci
|
run: npm i -g npm@"${{ steps.versions.outputs.NPM }}"
|
||||||
|
|
||||||
- name: Build tool
|
- name: Install dependencies
|
||||||
run: npm run build
|
run: npm ci
|
||||||
|
|
||||||
- name: Deploy commit to DigitalOcean Spaces
|
- name: Build tool
|
||||||
run: aws s3 sync ./dist s3://${{ secrets.SPACES_BUCKET }}/commits/nginxconfig/${{ github.sha }} --endpoint=https://${{ secrets.SPACES_REGION }}.digitaloceanspaces.com --acl public-read --content-encoding utf8
|
run: npm run build
|
||||||
env:
|
|
||||||
AWS_ACCESS_KEY_ID: ${{ secrets.SPACES_ACCESS_KEY_ID }}
|
|
||||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.SPACES_SECRET_ACCESS_KEY }}
|
|
||||||
AWS_DEFAULT_REGION: ${{ secrets.SPACES_REGION }}
|
|
||||||
|
|
||||||
- name: Leave a comment
|
- name: Deploy commit to DigitalOcean Spaces
|
||||||
run: npm run deploy:spaces:comment
|
run: aws s3 sync ./dist s3://${{ secrets.SPACES_BUCKET }}/commits/nginxconfig/${{ github.sha }} --endpoint=https://${{ secrets.SPACES_REGION }}.digitaloceanspaces.com --acl public-read --content-encoding utf8
|
||||||
env:
|
env:
|
||||||
REPO_NAME: ${{ github.repository }}
|
AWS_ACCESS_KEY_ID: ${{ secrets.SPACES_ACCESS_KEY_ID }}
|
||||||
COMMIT_SHA: ${{ github.sha }}
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.SPACES_SECRET_ACCESS_KEY }}
|
||||||
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
AWS_DEFAULT_REGION: ${{ secrets.SPACES_REGION }}
|
||||||
SPACES_REGION: ${{ secrets.SPACES_REGION }}
|
|
||||||
SPACES_BUCKET: ${{ secrets.SPACES_BUCKET }}
|
- name: Leave a comment
|
||||||
|
run: npm run deploy:spaces:comment
|
||||||
|
env:
|
||||||
|
REPO_NAME: ${{ github.repository }}
|
||||||
|
COMMIT_SHA: ${{ github.sha }}
|
||||||
|
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
SPACES_REGION: ${{ secrets.SPACES_REGION }}
|
||||||
|
SPACES_BUCKET: ${{ secrets.SPACES_BUCKET }}
|
||||||
|
|
|
@ -10,30 +10,35 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Read .nvmrc
|
- name: Read Node.js & NPM versions
|
||||||
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
|
run: |
|
||||||
id: nvm
|
echo "##[set-output name=NODE;]$(cat package.json | jq -r '.engines.node')"
|
||||||
|
echo "##[set-output name=NPM;]$(cat package.json | jq -r '.engines.npm')"
|
||||||
|
id: versions
|
||||||
|
|
||||||
- name: Use Node.js (.nvmrc)
|
- name: Use correct Node.js version
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
node-version: "${{ steps.nvm.outputs.NVMRC }}"
|
node-version: "${{ steps.versions.outputs.NODE }}"
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Use correct NPM version
|
||||||
run: npm ci
|
run: npm i -g npm@"${{ steps.versions.outputs.NPM }}"
|
||||||
|
|
||||||
- name: Test before production
|
- name: Install dependencies
|
||||||
run: npm test
|
run: npm ci
|
||||||
|
|
||||||
- name: Build tool
|
- name: Test before production
|
||||||
run: npm run build
|
run: npm test
|
||||||
|
|
||||||
- name: Deploy master to GitHub Pages
|
- name: Build tool
|
||||||
uses: JamesIves/github-pages-deploy-action@2.0.0
|
run: npm run build
|
||||||
env:
|
|
||||||
ACCESS_TOKEN: ${{ secrets.DEV_GITHUB_TOKEN }}
|
- name: Deploy master to GitHub Pages
|
||||||
BASE_BRANCH: master
|
uses: JamesIves/github-pages-deploy-action@2.0.0
|
||||||
BRANCH: gh-pages
|
env:
|
||||||
FOLDER: dist
|
ACCESS_TOKEN: ${{ secrets.DEV_GITHUB_TOKEN }}
|
||||||
|
BASE_BRANCH: master
|
||||||
|
BRANCH: gh-pages
|
||||||
|
FOLDER: dist
|
||||||
|
|
|
@ -7,37 +7,47 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Read .nvmrc
|
- name: Read Node.js & NPM versions
|
||||||
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
|
run: |
|
||||||
id: nvm
|
echo "##[set-output name=NODE;]$(cat package.json | jq -r '.engines.node')"
|
||||||
|
echo "##[set-output name=NPM;]$(cat package.json | jq -r '.engines.npm')"
|
||||||
|
id: versions
|
||||||
|
|
||||||
- name: Use Node.js (.nvmrc)
|
- name: Use correct Node.js version
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
node-version: "${{ steps.nvm.outputs.NVMRC }}"
|
node-version: "${{ steps.versions.outputs.NODE }}"
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Use correct NPM version
|
||||||
run: npm ci
|
run: npm i -g npm@"${{ steps.versions.outputs.NPM }}"
|
||||||
|
|
||||||
- name: Test with eslint
|
- name: Install dependencies
|
||||||
run: npm run test:eslint
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Test with eslint
|
||||||
|
run: npm run test:eslint
|
||||||
|
|
||||||
sass-lint:
|
sass-lint:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Read .nvmrc
|
- name: Read Node.js & NPM versions
|
||||||
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
|
run: |
|
||||||
id: nvm
|
echo "##[set-output name=NODE;]$(cat package.json | jq -r '.engines.node')"
|
||||||
|
echo "##[set-output name=NPM;]$(cat package.json | jq -r '.engines.npm')"
|
||||||
|
id: versions
|
||||||
|
|
||||||
- name: Use Node.js (.nvmrc)
|
- name: Use correct Node.js version
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
node-version: "${{ steps.nvm.outputs.NVMRC }}"
|
node-version: "${{ steps.versions.outputs.NODE }}"
|
||||||
|
|
||||||
|
- name: Use correct NPM version
|
||||||
|
run: npm i -g npm@"${{ steps.versions.outputs.NPM }}"
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
@ -49,16 +59,21 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Read .nvmrc
|
- name: Read Node.js & NPM versions
|
||||||
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
|
run: |
|
||||||
id: nvm
|
echo "##[set-output name=NODE;]$(cat package.json | jq -r '.engines.node')"
|
||||||
|
echo "##[set-output name=NPM;]$(cat package.json | jq -r '.engines.npm')"
|
||||||
|
id: versions
|
||||||
|
|
||||||
- name: Use Node.js (.nvmrc)
|
- name: Use correct Node.js version
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
node-version: "${{ steps.nvm.outputs.NVMRC }}"
|
node-version: "${{ steps.versions.outputs.NODE }}"
|
||||||
|
|
||||||
|
- name: Use correct NPM version
|
||||||
|
run: npm i -g npm@"${{ steps.versions.outputs.NPM }}"
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
Loading…
Reference in New Issue