Merge pull request #344 from metrico/fix_343 #213
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: 'Bump & Publish Multi-Arch' | |
on: | |
push: | |
branches: | |
- 'master' | |
paths-ignore: | |
- '**.md' | |
- '**.yml' | |
- '**.yaml' | |
jobs: | |
bump-version: | |
name: 'Bump Version on master & Publish' | |
runs-on: ubuntu-latest | |
steps: | |
- name: 'Checkout source code' | |
uses: 'actions/checkout@v2' | |
with: | |
ref: ${{ github.ref }} | |
- name: 'cat package.json' | |
run: cat ./package.json | |
- name: 'Automated Version Bump' | |
id: version-bump | |
uses: 'phips28/gh-action-bump-version@master' | |
with: | |
tag-prefix: 'v' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: 'cat package.json' | |
run: cat ./package.json | |
- name: 'Output Step' | |
env: | |
NEW_TAG: ${{ steps.version-bump.outputs.newTag }} | |
run: echo "new tag $NEW_TAG" | |
- name: Check NPM secret presence | |
id: checksecrets | |
shell: bash | |
run: | | |
if [ "$SECRET" == "" ]; then | |
echo ::set-output name=secretspresent::false | |
else | |
echo ::set-output name=secretspresent::true | |
fi | |
env: | |
SECRET: ${{ secrets.NPM_TOKEN }} | |
- uses: actions/setup-node@v1 | |
if: ${{ steps.checksecrets.outputs.secretspresent }} | |
with: | |
node-version: 14 | |
- name: Publish to NPM | |
if: ${{ steps.checksecrets.outputs.secretspresent }} | |
run: | | |
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN} | |
npm install | |
npm publish --access public | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Check Docker secret presence | |
id: checkdocker | |
shell: bash | |
run: | | |
if [ "$SECRET" == "" ]; then | |
echo ::set-output name=secretspresent::false | |
else | |
echo ::set-output name=secretspresent::true | |
fi | |
env: | |
SECRET: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Set up Docker QEMU | |
if: ${{ steps.checkdocker.outputs.secretspresent }} | |
uses: docker/setup-qemu-action@v2 | |
with: | |
platforms: amd64, arm64 | |
- name: Set up Docker Buildx | |
if: ${{ steps.checkdocker.outputs.secretspresent }} | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to DockerHub | |
if: ${{ steps.checkdocker.outputs.secretspresent }} | |
uses: docker/[email protected] | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push to Docker Hub | |
if: ${{ steps.checkdocker.outputs.secretspresent }} | |
id: docker_build | |
uses: docker/[email protected] | |
with: | |
platforms: linux/amd64, linux/arm64 | |
push: true | |
tags: | | |
qxip/qryn:latest | |
qxip/qryn:${{ steps.version-bump.outputs.newTag }} | |
qxip/cloki:latest | |
qxip/cloki:${{ steps.version-bump.outputs.newTag }} | |
- name: Log in to the GHCR registry | |
uses: docker/[email protected] | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push to GHCR | |
uses: docker/[email protected] | |
with: | |
platforms: linux/amd64, linux/arm64 | |
push: true | |
tags: | | |
ghcr.io/metrico/qryn:latest | |
ghcr.io/metrico/qryn:${{ steps.version-bump.outputs.newTag }} |