Use specific and latest version in actions

This commit is contained in:
Ajay Bura 2022-01-31 09:59:36 +05:30
parent 1d442cd0e2
commit 56de33c821
4 changed files with 12 additions and 10 deletions

View file

@ -10,22 +10,22 @@ jobs:
env: env:
PR_NUMBER: ${{github.event.number}} PR_NUMBER: ${{github.event.number}}
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2.4.0
- name: Build - name: Build
run: npm ci && npm run build run: npm ci && npm run build
- name: Upload Artifact - name: Upload Artifact
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2.3.1
with: with:
name: previewbuild name: previewbuild
path: dist path: dist
retention-days: 1 retention-days: 1
- uses: actions/github-script@v3.1.0 - uses: actions/github-script@v5.1.0
with: with:
script: | script: |
var fs = require('fs'); var fs = require('fs');
fs.writeFileSync('${{github.workspace}}/pr.json', JSON.stringify(context.payload.pull_request)); fs.writeFileSync('${{github.workspace}}/pr.json', JSON.stringify(context.payload.pull_request));
- name: Upload PR Info - name: Upload PR Info
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2.3.1
with: with:
name: pr.json name: pr.json
path: pr.json path: pr.json

View file

@ -14,7 +14,7 @@ jobs:
# workflow_run action (https://github.com/actions/download-artifact/issues/60) # workflow_run action (https://github.com/actions/download-artifact/issues/60)
# so instead we get this mess: # so instead we get this mess:
- name: 'Download artifact' - name: 'Download artifact'
uses: actions/github-script@v3.1.0 uses: actions/github-script@v5.1.0
with: with:
script: | script: |
var artifacts = await github.actions.listWorkflowRunArtifacts({ var artifacts = await github.actions.listWorkflowRunArtifacts({
@ -56,7 +56,7 @@ jobs:
console.log(`::set-output name=prnumber::${pr.number}`); console.log(`::set-output name=prnumber::${pr.number}`);
- name: Deploy to Netlify - name: Deploy to Netlify
id: netlify id: netlify
uses: nwtgck/actions-netlify@v1.2 uses: nwtgck/actions-netlify@v1.2.3
with: with:
publish-dir: dist publish-dir: dist
deploy-message: "Deploy from GitHub Actions" deploy-message: "Deploy from GitHub Actions"

View file

@ -11,9 +11,10 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v2.4.0
- uses: jsmrcaga/action-netlify-deploy@9cc40dcd499dd1511b3cc99912444f8970411cc6 - uses: jsmrcaga/action-netlify-deploy@v1.7.2
with: with:
install_command: "npm ci"
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE2_ID }} NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE2_ID }}
BUILD_DIRECTORY: "dist" BUILD_DIRECTORY: "dist"

View file

@ -10,9 +10,10 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v2.4.0
- uses: jsmrcaga/action-netlify-deploy@9cc40dcd499dd1511b3cc99912444f8970411cc6 - uses: jsmrcaga/action-netlify-deploy@v1.7.2
with: with:
install_command: "npm ci"
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
BUILD_DIRECTORY: "dist" BUILD_DIRECTORY: "dist"