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

Build issues #589

Open
andrewatduckpin opened this issue Feb 1, 2025 · 0 comments
Open

Build issues #589

andrewatduckpin opened this issue Feb 1, 2025 · 0 comments

Comments

@andrewatduckpin
Copy link

andrewatduckpin commented Feb 1, 2025

I am trying to deploy my built theme to WP Engine using Github Actions, but the resulting build has issues with asset references.

The assets are created in the dist directory, but the references are not correct. For instance, in the <head> of the document, the reference to the main stylesheet is "main.scss", not the compiled main.css file in the dist directory.

<link rel="stylesheet" id="Flynt/assets/main-css" href="https://domain.com/wp-content/themes/theme-name/assets/main.scss" media="all">

Here is my Github workflow. Is there a reason the resulting build wouldn't have correct asset references? It is following the same process I use on my local:

  1. Checkout code
  2. composer install
  3. npm install
  4. npm run build:production
name: Deploy to WP Engine
on:
  push:
    branches:
      - staging
      - main
jobs:
  build:
    runs-on: ubuntu-latest
    environment:
      name: ${{ github.ref_name }}
    steps:
      - name: Checkout code
        uses: actions/checkout@v4
        with:
          path: build
      - name: Run composer install
        working-directory: build
        run: composer install
      - name: Run npm install
        working-directory: build
        run: npm install
      - name: Build Theme
        working-directory: build
        run: npm run build:production
      - name: GitHub Action Deploy to WP Engine
        uses: wpengine/github-action-wpe-site-deploy@v3
        with:
          WPE_SSHG_KEY_PRIVATE: ${{ secrets.WPE_SSHG_KEY_PRIVATE }}
          WPE_ENV: ${{ secrets.WPE_INSTALL_NAME }}
          SRC_PATH: "build/"
          REMOTE_PATH: "wp-content/themes/${{ secrets.REPO_NAME }}/"
          CACHE_CLEAR: TRUE
Image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant