Skip to content

Commit

Permalink
ci/cd improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
yulianzavodnyk committed Sep 1, 2024
1 parent 0992102 commit 86422a3
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 72 deletions.
31 changes: 19 additions & 12 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,44 @@ on:
push:
branches:
- main
# Review gh actions docs if you want to further define triggers, paths, etc
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on

jobs:
deploy:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: npm
cache: 'npm'

# Cache node_modules
- name: Cache node_modules
uses: actions/cache@v3
with:
path: |
node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node_modules-
- name: Install dependencies
run: npm ci

# Always build the website
- name: Build website
run: npm run build

# Popular action to deploy to GitHub Pages:
# Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus
- name: Check build folder size
run: du -sh ./build

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# Build output to publish to the `gh-pages` branch:
publish_dir: ./build
# The following lines assign commit authorship to the official
# GH-Actions bot for deploys to `gh-pages` branch:
# https://github.com/actions/checkout/issues/13#issuecomment-724415212
# The GH actions bot is used by default if you didn't specify the two fields.
# You can swap them out with your own user credentials.
user_name: github-actions[bot]
user_email: 41898282+github-actions[bot]@users.noreply.github.com
60 changes: 3 additions & 57 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 10 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "my-website",
"version": "0.0.0",
"name": "iasa-articles-website",
"version": "1.0.0",
"private": true,
"scripts": {
"docusaurus": "docusaurus",
Expand All @@ -21,7 +21,14 @@
"prism-react-renderer": "^1.3.5",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-router-dom": "^6.9.0"
"react-router-dom": "^6.9.0",
"@docusaurus/plugin-google-analytics": "latest",
"@docusaurus/plugin-google-tag-manager": "latest",
"@docusaurus/plugin-sitemap": "latest",
"@docusaurus/plugin-pwa": "latest",
"@docusaurus/plugin-seo": "latest",
"@docusaurus/plugin-robots-txt": "latest",
"@docusaurus/plugin-content-blog": "latest"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "2.3.1"
Expand Down

0 comments on commit 86422a3

Please sign in to comment.