Update README.md #38
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, test and publish images | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
types: [opened, synchronize] | |
jobs: | |
cancel-previous-runs: | |
name: Cancel previous runs | |
runs-on: ubuntu-latest | |
if: "!contains(github.event.commits[0].message, '[skip ci]') && !contains(github.event.commits[0].message, '[ci skip]')" | |
steps: | |
- uses: styfle/cancel-workflow-action@0.9.1 | |
with: | |
access_token: ${{ github.token }} | |
build-test-push: | |
name: Build, test and publish | |
runs-on: ubuntu-latest | |
if: "!contains(github.event.commits[0].message, '[skip ci]') && !contains(github.event.commits[0].message, '[ci skip]')" | |
needs: cancel-previous-runs | |
strategy: | |
matrix: | |
version: [ '7.2', '8.0', '8.1', '8.2', '8.3' ] | |
env: | |
VERSION: "${{ matrix.version }}" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build images | |
run: | | |
make build VERSION=${VERSION} | |
make -C dev build VERSION=${VERSION} | |
- name: Test images | |
run: | | |
make test VERSION=${VERSION} | |
make -C dev test VERSION=${VERSION} | |
- name: Login to Docker HUB | |
if: "github.event_name != 'pull_request'" | |
run: echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin | |
env: | |
DOCKER_PASSWORD: "${{ secrets.DOCKER_PASSWORD }}" | |
DOCKER_USERNAME: "${{ secrets.DOCKER_USERNAME }}" | |
- name: Publish images | |
if: "github.event_name != 'pull_request'" | |
run: | | |
make push VERSION=${VERSION} | |
make -C dev push VERSION=${VERSION} |