Update nsp version #11
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 test and publish Docker image | |
on: | |
push: | |
branches: | |
- master | |
- dev | |
pull_request: | |
branches: | |
- master | |
- dev | |
jobs: | |
publish: | |
name: Publish to Docker Hub | |
runs-on: ubuntu-latest | |
env: | |
DOCKER_IMAGE: carrotsoup/remotens | |
PLATFORMS: linux/amd64,linux/arm64 | |
steps: | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKER_USER }} | |
password: ${{ secrets.DOCKER_PASS }} | |
- name: Clean git Checkout | |
if: success() | |
uses: actions/checkout@v2 | |
- name: Build, tag and push the dev Docker image | |
if: success() && github.ref == 'refs/heads/dev' | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
push: true | |
no-cache: true | |
platforms: ${{ env.PLATFORMS }} | |
tags: | | |
${{ env.DOCKER_IMAGE }}:dev_${{ github.sha }} | |
${{ env.DOCKER_IMAGE }}:latest_dev | |
- name: Get Nightscout release version | |
if: success() && github.ref == 'refs/heads/master' | |
id: package-version | |
uses: martinbeentjes/npm-get-version-action@master | |
- name: Build, tag and push the master Docker image | |
if: success() && github.ref == 'refs/heads/master' | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
push: true | |
no-cache: true | |
platforms: ${{ env.PLATFORMS }} | |
tags: | | |
${{ env.DOCKER_IMAGE }}:${{ steps.package-version.outputs.current-version }} | |
${{ env.DOCKER_IMAGE }}:latest |