diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index e4e7ead..ebcedf3 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,40 +1,41 @@ name: Deploy to GitHub Pages on: + # Trigger the workflow every time you push to the `main` branch + # Using a different branch name? Replace `main` with your branch’s name 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 + branches: [main] + # Allows you to run this workflow manually from the Actions tab on GitHub. + workflow_dispatch: + +# Allow this job to clone the repo and create a page deployment +permissions: + contents: read + pages: write + id-token: write jobs: - deploy: - name: Deploy to GitHub Pages + build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v3 - with: - node-version: 18 - cache: npm - - - name: Install dependencies - run: npm ci - - name: Build website - run: npm run build + - name: Checkout your repository using git + uses: actions/checkout@v4 + - name: Install, build, and upload your site + uses: withastro/action@v4 + # with: + # path: . # The root location of your Astro project inside the repository. (optional) + # node-version: 20 # The specific version of Node that should be used to build your site. Defaults to 20. (optional) + # package-manager: pnpm@latest # The Node package manager that should be used to install dependencies and build your site. Automatically detected based on your lockfile. (optional) + # env: + # PUBLIC_POKEAPI: 'https://pokeapi.co/api/v2' # Use single quotation marks for the variable value. (optional) - # Popular action to deploy to GitHub Pages: - # Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus + deploy: + needs: build + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: - 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: ./dist - # 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 + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/test-deploy.yml b/.github/workflows/test-deploy.yml deleted file mode 100644 index 0619ea4..0000000 --- a/.github/workflows/test-deploy.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Test deployment - -on: - pull_request: - 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: - test-deploy: - name: Test deployment - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v3 - with: - node-version: 18 - cache: npm - - - name: Install dependencies - run: npm ci - - name: Test build website - run: npm run build diff --git a/src/content/docs/code quality/01-editorconfig.md b/src/content/docs/code quality/01-editorconfig.md index ed3d73c..7ca8001 100644 --- a/src/content/docs/code quality/01-editorconfig.md +++ b/src/content/docs/code quality/01-editorconfig.md @@ -8,7 +8,7 @@ These things can be negligible when you are working on your own, but can become By using a specific file `.editorconfig` in the root of your project, your editor (or plugin) can automatically use the correct convention. This way, you can be sure that everyone is using the same settings. -In the end, it is up to you to decide which settings you want to use. You can find a list of all possible settings [here](http://editorconfig.org/#file-format-details). The following can be a great start: +In the end, it is up to you to decide which settings you want to use. You can find [a list of all possible settings here](http://editorconfig.org/#file-format-details). The following can be a great start: ```editorconfig root = true diff --git a/src/content/docs/vite-01-intro.md b/src/content/docs/vite-01-intro.md index 55ad2a2..20eb9bc 100644 --- a/src/content/docs/vite-01-intro.md +++ b/src/content/docs/vite-01-intro.md @@ -94,7 +94,7 @@ When you open the URL in your browser, you will see a basic demo page. If you want to stop the dev server, you can enter `Ctrl + C` in the terminal. -### HMR +### HMR in action Organize your desktop so that a browser and VS Code are side by side. Make sure that the Vite dev server is running. Now edit the style.css to give the page a red background. You will see that the background of the page turns red immediately --without doing a full page refresh.- When you open up your Developer Tools and inspect the head element, you will experience that only the style tag changes when you change the background color.