Merge pull request #118 from espruino/dependabot/npm_and_yarn/es5-ext… #12
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: Create Docker Images | |
on: | |
push: | |
branches: [ master ] | |
jobs: | |
build: | |
env: | |
NODE_LATEST: 16 | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node: [ 14, 16, 18 ] | |
suffix: [ "" ] | |
steps: | |
- name: 1-checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: 2-setup-image-setting | |
id: setting | |
run: | | |
SUFFIX="" | |
if [ "${{ matrix.suffix }}" != "" ]; then | |
SUFFIX="-${{ matrix.suffix}}" | |
fi | |
TAGS="ghcr.io/${{ github.repository }}:${{ matrix.node }}$SUFFIX" | |
if [ "${{ matrix.node }}" == "${{ env.NODE_LATEST }}" ]; then | |
TAGS="$TAGS,ghcr.io/${{ github.repository }}:latest$SUFFIX" | |
fi | |
echo "current tags $TAGS" | |
echo "TAGS=$TAGS" >> $GITHUB_ENV | |
- name: 3-setup-tags-toLowerCase | |
uses: actions/github-script@v6 | |
id: tags-tolowercase | |
with: | |
script: return `${process.env.TAGS.toLowerCase()}` | |
result-encoding: string | |
- name: 4-setup-qemu-action | |
uses: docker/setup-qemu-action@v2 | |
- name: 5-login-action | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: 6-setup-buildx-action | |
uses: docker/setup-buildx-action@v2 | |
- name: 7-build-push-action | |
uses: docker/build-push-action@v3 | |
continue-on-error: true | |
with: | |
context: ./ | |
file: ./Dockerfile | |
platforms: linux/amd64, linux/arm64, linux/arm/v7, linux/arm/v6 | |
push: true | |
build-args: | | |
NODE_VERSION=${{ matrix.node }} | |
tags: | | |
${{ steps.tags-tolowercase.outputs.result }} |