Skip to content

ci(deps): update docker/build-push-action action to v6.11.0 #707

ci(deps): update docker/build-push-action action to v6.11.0

ci(deps): update docker/build-push-action action to v6.11.0 #707

Workflow file for this run

name: Revue CI and CD
on:
push:
paths-ignore:
- 'README.md'
- 'CHANGELOG.md'
- 'renovate.json'
pull_request:
workflow_dispatch:
defaults:
run:
shell: bash
concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: ${{ !contains(github.ref, 'main') }}
jobs:
build:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-24.04
- macos-12
- windows-2022
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Build
run: ./gradlew npmBuild build --info
- name: Test
run: ./gradlew auth:npmTest user:npmTest alarm:npmTest device:npmTest log:npmTest notification:npmTest location:npmTest --info --parallel
style:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Check format
run: ./gradlew format npmFormat --info
- name: Check lint
run: ./gradlew npmLint --info
build-website:
defaults:
run:
working-directory: docs/website
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: package.json
- name: Build the website
run: |
npm install
npm run build
cd ../..
./gradlew generate-openapi-website generate-openapi-index-page
mv build/openapi docs/website/build
- name: Build AsyncAPI
run: |
cd ../api/asyncapi
npm install
npx -p @asyncapi/cli asyncapi generate fromTemplate ./specification.yml @asyncapi/html-template -o ./build/asyncapi --force-write
mv ./build/asyncapi/ ../../website/build
- uses: actions/[email protected]
with:
name: website
path: docs/website/build
compute-next-version:
needs:
- build
- style
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
outputs:
will-release: ${{ steps.compute-next-version.outputs.will-release }}
next-version: ${{ steps.compute-next-version.outputs.next-version }}
steps:
- name: Checkout repo
uses: actions/[email protected]
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '21'
cache: 'npm'
- name: Pre-compute the next version
id: compute-next-version
uses: nicolasfara/[email protected]
with:
github-token: ${{ secrets.GH_TOKEN }}
- name: Use the next version
run: |
echo "Will release: ${{ steps.compute-next-version.outputs.will-release }}"
echo "The next version is ${{ steps.compute-next-version.outputs.next-version }}"
release:
needs:
- compute-next-version
- build-website
runs-on: ubuntu-latest
concurrency:
# Only one release job at a time per branch, strictly sequential.
group: release-${{ github.event.number || github.ref }}
permissions:
contents: write
issues: write
pull-requests: write
id-token: write
if: >-
!github.event.repository.fork
&& (
github.event_name != 'pull_request'
|| github.event.pull_request.head.repo.full_name == github.repository
)
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GH_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm clean-install
- name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
run: npm audit signatures
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
run: npx semantic-release
deploy-website:
runs-on: ubuntu-latest
needs:
- build-website
- release
if: >-
!github.event.repository.fork
&& (
github.event_name != 'pull_request'
|| github.event.pull_request.head.repo.full_name == github.repository
) && fromJSON(needs.compute-next-version.outputs.will-release)
steps:
- uses: actions/checkout@v4
- uses: actions/[email protected]
with:
name: website
path: docs/website/build
- uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ secrets.GH_TOKEN }}
folder: docs/website/build
docker:
name: Push ${{ matrix.image }} image to docker hub
concurrency:
group: release-${{ github.event.number || github.ref }}-docker-${{ matrix.image }}
strategy:
fail-fast: false
matrix:
image:
- alarm
- auth
- device
- frontend
- location
- log
- monitoring
- notification
- recognition
- user
needs:
- compute-next-version
- release
runs-on: ubuntu-latest
env:
DOCKER_BUILD: true
if: >-
!github.event.repository.fork
&& (
github.event_name != 'pull_request'
|| github.event.pull_request.head.repo.full_name == github.repository
) && fromJSON(needs.compute-next-version.outputs.will-release)
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/[email protected]
- name: Set up Docker Buildx
uses: docker/[email protected]
- name: Login to Docker Hub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build and push
uses: docker/[email protected]
env:
releaseTag: ${{
fromJSON(needs.compute-next-version.outputs.will-release)
&& needs.compute-next-version.outputs.next-version || 'ci'
}}
with:
context: .
file: ./${{ matrix.image }}/Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ fromJSON(needs.compute-next-version.outputs.will-release) }}
tags: |
letsdothisshared/revue-${{ matrix.image }}:${{ env.releaseTag }}
letsdothisshared/revue-${{ matrix.image }}:latest
success:
runs-on: ubuntu-latest
needs:
- build
- style
- build-website
- release
- docker
- compute-next-version
- deploy-website
# Always run this job, even if the previous jobs failed
if: >-
always() && (failure() || !contains(join(needs.*.result, ','), 'cancelled'))
steps:
- name: None of the dependant jobs should fail
run: ${{ !contains(join(needs.*.result, ','), 'failure') }}