Build / Update #220
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build / Update | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
pull_request: | |
schedule: | |
- cron: '0 0 * * *' | |
jobs: | |
image: | |
runs-on: ubuntu-20.04 | |
timeout-minutes: 90 | |
strategy: | |
fail-fast: false | |
matrix: | |
family: | |
- debian-shell | |
- nginx-static,nginx-console,debian-shell | |
- node,node-console | |
- php-apache,php-apache-shell,php-console | |
- python-passenger,python-console | |
- ruby-passenger,ruby-console | |
env: | |
FAMILY: ${{ matrix.family }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup BATS | |
uses: mig4/setup-bats@v1 | |
with: | |
bats-version: 1.2.1 | |
- name: Detect bats path | |
id: bats | |
run: echo "::set-output name=path::$(which bats)" | |
- name: Set up NodeJS | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Install NodeJS dependencies | |
run: npm install | |
- name: Verify no pending changes | |
run: | | |
node ./generate.js -f "$FAMILY" -g | |
git status | |
git diff HEAD | |
test -z "$(git status --porcelain "$FAMILY")" | |
- name: Build images | |
run: node ./generate.js -f "$FAMILY" -b | |
- name: Test images | |
run: sudo -E node ./generate.js -f "$FAMILY" -t | |
env: | |
BATS_PATH: ${{ steps.bats.outputs.path }} | |
- name: Login to h1cr.io Registry | |
uses: docker/login-action@v1 | |
with: | |
registry: h1cr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.REPOSITORY_TOKEN }} | |
if: success() && github.ref == 'refs/heads/master' | |
- name: Deploy images | |
run: node ./generate.js -f "$FAMILY" -p | |
if: success() && github.ref == 'refs/heads/master' |