ci #82
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: ci | |
on: | |
schedule: | |
# build every first of the month | |
- cron: '0 0 1 * *' | |
push: | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
node: [ 16, 17, 18, 19, 20, 21, 22 ] | |
distroAddon: [ '', '-alpine' ] | |
include: | |
- node: 20 | |
distroAddon: '' | |
additionalTags: "ghcr.io/pluswerk/node-dev:lts,pluswerk/node-dev:lts," | |
- node: 20 | |
distroAddon: '-alpine' | |
additionalTags: "ghcr.io/pluswerk/node-dev:lts-alpine,pluswerk/node-dev:lts-alpine," | |
- node: 22 | |
distroAddon: '' | |
additionalTags: "ghcr.io/pluswerk/node-dev:latest,ghcr.io/pluswerk/node-dev:current,pluswerk/node-dev:latest,pluswerk/node-dev:current," | |
- node: 22 | |
distroAddon: '-alpine' | |
additionalTags: "ghcr.io/pluswerk/node-dev:latest-alpine,ghcr.io/pluswerk/node-dev:current-alpine,pluswerk/node-dev:latest-alpine,pluswerk/node-dev:current-alpine," | |
steps: | |
- | |
name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- | |
name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- | |
name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- | |
name: Build and push ${{ matrix.node }} | |
id: docker_build | |
uses: docker/build-push-action@v6 | |
with: | |
push: ${{ github.ref == 'refs/heads/main' }} | |
tags: ${{ matrix.additionalTags }}ghcr.io/pluswerk/node-dev:${{ matrix.node }}${{ matrix.distroAddon }},pluswerk/node-dev:${{ matrix.node }}${{ matrix.distroAddon }} | |
build-args: | | |
FROM=node:${{ matrix.node }}${{ matrix.distroAddon }} | |
DIST_ADDON=${{ matrix.distroAddon }} | |
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8 | |
- | |
name: Image digest | |
run: | | |
echo ${{ steps.docker_build.outputs.digest }} | |
echo ${{ steps.docker_build_dev.outputs.digest }} |