Useful actions shared between our repositories.
The content of this repository is made available to the public under the MIT license, as others may find our dev / CI setup useful - or at least educational.
Run bundle update against a repository and create a pull request with any changes.
checkout-key: the SSH key to use to check out the repository. Details of setting up this key can be found in the wiki.container(optional): Run in a container with ruby already initialised.working-directory(optional): the working directory where Gemfile can be found. Defaults to the repository root.
name: Bundle Update
on:
schedule:
- cron: '0 7 * * THU'
workflow_dispatch:
jobs:
bundle-update:
name: Run bundle update
runs-on: [ self-hosted, linux, x64 ]
container: docker://ghcr.io/university-of-york/faculty-dev-docker-images/ci/aws-lambda-ruby-dev:2.7
steps:
- uses: university-of-york/faculty-dev-actions/bundle-update@v1
with:
checkout-key: ${{ secrets.BUNDLE_UPDATE_SSH_PRIVATE_KEY }}
container: "true"Run bundle update --group development test against a repository and auto-merge the pull request with any changes.
checkout-key: the SSH key to use to check out the repository. Details of setting up this key can be found in the wiki.container(optional): Run in a container with ruby already initialised.github-token: the token used in the workflow to allow the PR to be updated and auto-merged.working-directory(optional): the working directory where Gemfile can be found. Defaults to the repository root.
name: Bundle Update [development, test]
on:
schedule:
- cron: '0 6 * * *'
workflow_dispatch:
permissions:
pull-requests: write
contents: write
jobs:
bundle-update:
name: Run `bundle update --group development test` and auto-merge
runs-on: [ self-hosted, linux, x64 ]
container: docker://ghcr.io/university-of-york/faculty-dev-docker-images/ci/aws-lambda-ruby-dev:2.7
steps:
- uses: university-of-york/faculty-dev-actions/bundle-update-dev-container@v1
with:
checkout-key: ${{ secrets.BUNDLE_UPDATE_SSH_PRIVATE_KEY }}
container: "true"
github-token: ${{ secrets.GITHUB_TOKEN }}Run bundle exec bundler-audit check --update against a repository.
working-directory(optional): the working directory where Gemfile can be found. Defaults to the repository root.
jobs:
bundler-audit:
name: Bundler Audit
runs-on: ubuntu-latest
steps:
- uses: university-of-york/faculty-dev-actions/bundler-audit@v1Deploys the application onto an on-premise server, via the sys-docker-rsyncssh-image docker action.
deploy-server: the name of the webserver to deploy tossh-key: the SSH key of the SSH user on the webserver
jobs:
deployment:
name: Deploy to servers
runs-on: [self-hosted, Linux, X64]
strategy:
fail-fast: false
matrix:
environment: [prod]
environment: ${{ matrix.environment }}
steps:
- uses: university-of-york/faculty-dev-actions/deploy-legacy-on-prem@v1
with:
deploy-server: ${{ vars.DEPLOY_SSH_HOST }}
ssh-key: ${{ secrets.DEPLOY_SSH_PRIVATE_KEY }}Used for pull requests to check if the changelog has been updated if files in the lib/, bin/, or spec/
directories have been updated. The test will return a fail if changes are required but haven't been made.
changelog-file-path(optional): relative path to the changelog file. Defaults toCHANGELOG.md.
jobs:
gem-changelog-update-check:
name: Check for CHANGELOG change
runs-on: ubuntu-latest
steps:
- uses: university-of-york/faculty-dev-actions/gem-changelog-update-check@v1
with:
changelog-file-path: docs/CHANGELOG.mdDeploys the named gem to gemfury
gem-name: the name of the gem to buildgemfury-push-token: the token used to authenticate with gemfuryprerelease-only(optional): set to anything other than "false" to only upload prerelease versionsworking-directory(optional): the working directory where Gemfile can be found. Defaults to the repository root.
jobs:
gemfury-deploy:
name: Gemfury Deployment
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: university-of-york/faculty-dev-actions/gemfury-deployment@v1
with:
gem-name: uoy-faculty-new_gem
gemfury-push-token: ${{ secrets.GEMFURY_PUSH_TOKEN }}Runs npm update on a runner against a repository and create a pull request with any changes.
checkout-key: the SSH key to use to check out the repository. Details of setting up this key can be found in the wiki.node-version(optional): the version of node to use. Defaults to 18.working-directory(optional): the working directory where Gemfile can be found. Defaults to the repository root.
Run rspec tests in the AWS lambda environment.
artifact-name(optional): the name of the vue artifact to download.
This is an example with a postgres database available for tests.
jobs:
rspec:
name: RSpec tests
runs-on: [ self-hosted, linux, x64 ]
container: docker://ghcr.io/university-of-york/faculty-dev-docker-images/ci/aws-lambda-ruby-dev:2.7
services:
postgres:
image: ghcr.io/university-of-york/faculty-dev-db-pristine:latest
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: university-of-york/faculty-dev-actions/rspec-lambda@v1
env:
DB_HOST: postgres
DB_USER: sinatra_base_appAs above, but expects the rspec-github-actions-summary and rspec-github gems to be installed to generate output for
github's reports.
Run rspec tests on a runner.
working-directory(optional): the working directory where Gemfile can be found. Defaults to the repository root.
As above, but expects the rspec-github-actions-summary and rspec-github gems to be installed to generate output for
github's reports.
Run rubocop against a repository.
working-directory(optional): the working directory where Gemfile can be found. Defaults to the repository root.
jobs:
rubocop:
name: Rubocop
runs-on: ubuntu-latest
steps:
- uses: university-of-york/faculty-dev-actions/rubocop@v1Build Vue components and upload them as an artifact named vue-components
node-version(optional): the version of node to use. Defaults to 14.working-directory(optional): the working directory where Gemfile can be found. Defaults to the repository root.
jobs:
vue-build:
name: Build Vue components
runs-on: ubuntu-latest
steps:
- uses: university-of-york/faculty-dev-actions/vue-build@v1