From db514aa48582042727bbd456600ba0aec9a702ce Mon Sep 17 00:00:00 2001 From: Jasper Timmer Date: Sun, 22 Oct 2023 21:38:36 +0200 Subject: [PATCH] use artifacts between files --- .github/workflows/base-jobs.yml | 22 ++++++++++++++++++---- .github/workflows/pr-builder.yml | 15 ++++++++++++--- .github/workflows/website-builder.yml | 13 +++++++++++-- 3 files changed, 41 insertions(+), 9 deletions(-) diff --git a/.github/workflows/base-jobs.yml b/.github/workflows/base-jobs.yml index a0c5191f8..44bdacca5 100644 --- a/.github/workflows/base-jobs.yml +++ b/.github/workflows/base-jobs.yml @@ -4,10 +4,13 @@ on: workflow_call: jobs: - website: - name: Build the Rascal website + prepare-sources: + name: Prepare the website sources runs-on: buildjet-4vcpu-ubuntu-2204 - steps: + steps: + - name: Clone + uses: actions/checkout@v4 + - uses: actions/setup-java@v3 with: distribution: 'temurin' @@ -28,4 +31,15 @@ jobs: # Copy docs from dependent projects, run tutor on local courses folder and copy results into docs and static/assets - name: Run rascal-tutor and reuse libraries - run: MAVEN_OPTIONS="-Xss256m -Xmx3G" mvn -B clean package -Dwebdriver.chrome.driver=/usr/local/bin/chromedriver -Dwebdriver.chrome.browser=`which chrome` \ No newline at end of file + run: MAVEN_OPTIONS="-Xss256m -Xmx3G" mvn -B clean package -Dwebdriver.chrome.driver=/usr/local/bin/chromedriver -Dwebdriver.chrome.browser=`which chrome` + + - uses: actions/upload-artifact@v3 + with: + name: sources + path: | + . + !target/ + !.git/ + !.github/ + !.vscode + !META-INF \ No newline at end of file diff --git a/.github/workflows/pr-builder.yml b/.github/workflows/pr-builder.yml index a04d59deb..9c7913361 100644 --- a/.github/workflows/pr-builder.yml +++ b/.github/workflows/pr-builder.yml @@ -7,15 +7,24 @@ on: jobs: website-pr: - name: Build the Rascal website + name: Sanity check the Rascal website runs-on: buildjet-4vcpu-ubuntu-2204 steps: + # Checkout only the workflow folder for this commit (else it uses main branch) - name: Clone - uses: actions/checkout@v3 + uses: actions/checkout@v4 + with: + filter: '.github' - # Do the base actions + # Do the base actions - uses: ./.github/base-jobs.yml + # Download prepared sources from base + - name: Download sources + uses: actions/download-artifact@v3 + with: + name: sources + # Do a dummy build to see if there are errors - name: Install dependencies run: yarn install --frozen-lockfile diff --git a/.github/workflows/website-builder.yml b/.github/workflows/website-builder.yml index 42e55673b..5a1c889a9 100644 --- a/.github/workflows/website-builder.yml +++ b/.github/workflows/website-builder.yml @@ -7,15 +7,24 @@ on: jobs: website: - name: Build the Rascal website + name: Deploy the Rascal website runs-on: buildjet-4vcpu-ubuntu-2204 steps: + # Checkout only the workflow folder for this commit (else it uses main branch) - name: Clone - uses: actions/checkout@v3 + uses: actions/checkout@v4 + with: + filter: '.github' # Do the base actions - uses: ./.github/base-jobs.yml + # Download prepared sources from base + - name: Download sources + uses: actions/download-artifact@v3 + with: + name: sources + # Production deploy - name: Netlify Deploy uses: jsmrcaga/action-netlify-deploy@v2.0.0