From 109ff3e11867fd44b9495cb3c08d121c1e95daf2 Mon Sep 17 00:00:00 2001 From: Evan Pratten Date: Sun, 18 Dec 2022 12:07:24 -0500 Subject: [PATCH] I think I understand the workflow now --- .github/workflows/build-on-commit.yml | 13 ------------- .github/workflows/{build-site.yml => build.yml} | 12 ++++++++++++ .github/workflows/{deploy-master.yml => deploy.yml} | 10 ++++++++-- 3 files changed, 20 insertions(+), 15 deletions(-) delete mode 100644 .github/workflows/build-on-commit.yml rename .github/workflows/{build-site.yml => build.yml} (67%) rename .github/workflows/{deploy-master.yml => deploy.yml} (67%) diff --git a/.github/workflows/build-on-commit.yml b/.github/workflows/build-on-commit.yml deleted file mode 100644 index a1821f8..0000000 --- a/.github/workflows/build-on-commit.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: Build Commit -on: - push: - branches: - - "*" - - "!master" - -jobs: - call-build: - runs-on: ubuntu-latest - needs: build - steps: - - uses: ./.github/workflows/build-site.yml diff --git a/.github/workflows/build-site.yml b/.github/workflows/build.yml similarity index 67% rename from .github/workflows/build-site.yml rename to .github/workflows/build.yml index f2dcf20..d05f658 100644 --- a/.github/workflows/build-site.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,12 @@ name: Build Website on: + push: + branches: + - "*" + # Master has its own set of build rules, + # and will eventually call this script on its own + - "!master" workflow_call: jobs: @@ -31,3 +37,9 @@ jobs: - name: Delete dist gitignore run: sudo rm -f ./public/dist/.gitignore + + - name: Publish site as artifact + uses: actions/upload-artifact@v2 + with: + name: website-static-bundle + path: ./public diff --git a/.github/workflows/deploy-master.yml b/.github/workflows/deploy.yml similarity index 67% rename from .github/workflows/deploy-master.yml rename to .github/workflows/deploy.yml index 77ea435..fcfc5e7 100644 --- a/.github/workflows/deploy-master.yml +++ b/.github/workflows/deploy.yml @@ -5,12 +5,18 @@ on: - "master" jobs: + build: + uses: ./.github/workflows/build.yml + deploy: runs-on: ubuntu-latest needs: build steps: - - name: Build Site - uses: ./.github/workflows/common/build-site.yml + - name: Download bundle artifact + uses: actions/download-artifact@v2 + with: + name: website + path: ./public - name: Deploy to GitHub Pages if: success()