Skip to content

Commit

Permalink
Revert "Update update-filecache.yml"
Browse files Browse the repository at this point in the history
This reverts commit c25196a.
  • Loading branch information
caendesilva committed Apr 30, 2022
1 parent c25196a commit abc21e7
Showing 1 changed file with 21 additions and 75 deletions.
96 changes: 21 additions & 75 deletions .github/workflows/update-filecache.yml
Original file line number Diff line number Diff line change
@@ -1,91 +1,37 @@
# Ensure a consistent state for production releases
name: Prepare for production
name: Update Filecache

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
branches: [master]

workflow_dispatch:

permissions:
contents: read
contents: write
pull-requests: write

jobs:
build-and-test:

build-filecache:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Validate composer.json and composer.lock
run: composer validate --strict

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install Composer dependencies
run: composer install --prefer-dist --no-progress

- name: Run test suite
run: vendor/bin/pest

rebuild-frontend-files:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- uses: actions/checkout@v3

- name: Install Composer dependencies
run: composer install --prefer-dist --no-progress

- name: Clean _site directory
run: rm -rf _site && mkdir _site
- name: Clean _media directory
run: rm -rf _media && mkdir _media
- name: Compile the checksums and save the filecache
run: cd resources/data && php filecacheGenerator.php

- name: Setup Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: 'npm'
- name: Install Node dependencies
run: npm ci
- name: Build frontend files
run: npm run prod
- name: Check if any changes were made
uses: tj-actions/verify-changed-files@v9
id: verify-changed-files
with:
files: resources/data/filecache.json

propagate-frontend-to-hydefront:
if: github.event_name == 'push'
needs: rebuild-frontend-files
runs-on: ubuntu-latest
steps:
- name: Todo implement job
run: echo Not yet implemented

create-hyde-merge-pull-request:
needs: [build-and-test, rebuild-frontend-files]
runs-on: ubuntu-latest
steps:
- name: Create Pull Request with the new assets
- name: Create Pull Request with the new filecache
if: steps.verify-changed-files.outputs.files_changed == 'true'
uses: peter-evans/create-pull-request@v4
with:
commit-message: Automatic build update
title: Update Frontend Assets
body: Updated default app.css and cleaned the media directories.
branch: update-frontend
commit-message: Automatic Filecache Update
title: Update Filecache
body: Updated the filecache.json with new resource file checksums.
branch: update-checksums
base: master

0 comments on commit abc21e7

Please sign in to comment.