Fixed ordering code - made it simpler to understand #39
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 and Publish Plugin | |
on: | |
create: | |
tags: | |
- "*" | |
push: | |
branches: | |
- "**" | |
tags-ignore: | |
- "**" | |
jobs: | |
build_nodejs_plugin_release: | |
uses: BetterCorp/service-base-build-workflows/.github/workflows/node.yml@master | |
with: | |
PUBLISH: true | |
WORKING_DIR: ./nodejs | |
secrets: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
NPM_PUBLISH_TOKEN: ${{ secrets.NPM2_TOKEN_PUB }} | |
NPM_EMAIL: ${{ secrets.NPM_EMAIL }} | |
NPM_NAME: ${{ secrets.NPM_NAME }} | |
docker_nodejs_plugin_release: | |
needs: [build_nodejs_plugin_release] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
# - run: mkdir ./ci-build-dist | |
# working-directory: ./nodejs | |
# - name: Download artifact | |
# uses: actions/download-artifact@v4 | |
# with: | |
# name: node-${{ needs.build_nodejs_plugin_release.outputs.tag }}-${{ needs.build_nodejs_plugin_release.outputs.version }} | |
# path: ./nodejs/ci-build-dist/ | |
# - name: Extract artifact | |
# working-directory: ./nodejs | |
# run: | | |
# tar -xzf ./ci-build-dist/as-built.tar.gz -C ./ | |
# - run: rm -rfv ./ci-build-dist | |
# working-directory: ./nodejs | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@master | |
with: | |
platforms: all | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@master | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USER }} | |
password: ${{ secrets.DOCKER_HUB_TOKEN }} | |
- name: Build | |
uses: docker/build-push-action@v5 | |
if: needs.build_nodejs_plugin_release.outputs.tag != 'latest' | |
with: | |
build-args: | | |
BSB_VERSION=${{ needs.build_nodejs_plugin_release.outputs.version }} | |
builder: ${{ steps.buildx.outputs.name }} | |
context: ./nodejs/ | |
file: ./nodejs/Dockerfile | |
#platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x | |
# amd64, arm32v6, arm32v7, arm64v8, ppc64le, s390x | |
platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8 | |
push: true | |
tags: | | |
betterweb/service-base:node-${{ needs.build_nodejs_plugin_release.outputs.tag }} | |
betterweb/service-base:node-${{ needs.build_nodejs_plugin_release.outputs.version }} | |
- name: Build Latest | |
uses: docker/build-push-action@v5 | |
if: needs.build_nodejs_plugin_release.outputs.tag == 'latest' | |
with: | |
build-args: | | |
BSB_VERSION=${{ needs.build_nodejs_plugin_release.outputs.version }} | |
builder: ${{ steps.buildx.outputs.name }} | |
context: ./nodejs/ | |
file: ./nodejs/Dockerfile | |
platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8 | |
push: true | |
tags: | | |
betterweb/service-base:node-${{ needs.build_nodejs_plugin_release.outputs.tag }} | |
betterweb/service-base:node-${{ needs.build_nodejs_plugin_release.outputs.version }} | |
betterweb/service-base:node |