Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix yml #7

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/build-and-preview-site.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build and Preview Site
on:
pull_request:
branches: [ master ]
types: [opened, synchronize, reopened]


jobs:
site-preview:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@master
with:
persist-credentials: false
fetch-depth: 1

- name: Install and Build 🔧
run: |
npm install
npm run noIndex

- name: Zip Site
run: bash ./script.sh

- name: Upload files
uses: actions/upload-artifact@master
with:
name: public-dir
path: ./public-dir.zip
retention-days: 1
- name: Triger Inner workflow
run: echo "trigering inner workflow"
24 changes: 20 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,28 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2

- name: Install Netlify CLI
run: npm install -g netlify-cli
- name: Download Site dir
uses: dawidd6/action-download-artifact@v2
with:
github_token: ${{ secrets.GH_ACCESS_TOKEN }}
workflow: build-and-preview-site.yml
run_id: ${{ github.event.workflow_run.id }}
name: public-dir

- name: Build and deploy to Netlify
- name: Unzip Site
run: |
netlify deploy --dir=Lets-Learn-Github --prod
rm -rf ./public
unzip public-dir.zip
rm -f public-dir.zip

- name: Deploy to Netlify
id: netlify
uses: nwtgck/[email protected]
with:
publish-dir: 'public'
production-deploy: false
github-token: ${{ secrets.GH_ACCESS_TOKEN }}
enable-commit-comment: false
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
19 changes: 19 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "open-source-sudhanshu",
"version": "1.0.0",
"description": "package for open-source individuals",
"main": "index.js",
"scripts": {
"test": "npm build"
},
"repository": {
"type": "git",
"url": "git+https://github.com/sudhanshutech/Lets-Get-To-Open-Source.git"
},
"author": "Sudhanshu Dasgupta",
"license": "ISC",
"bugs": {
"url": "https://github.com/sudhanshutech/Lets-Get-To-Open-Source/issues"
},
"homepage": "https://github.com/sudhanshutech/Lets-Get-To-Open-Source#readme"
}
Loading