Merge pull request #1045 from manuc66/dependabot/npm_and_yarn/typescr… #1029
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: Docker Image CI | |
on: | |
push: | |
branches: [ "master", "feature/**" ] | |
pull_request: | |
branches: [ "master" ] | |
jobs: | |
sonarcloud: | |
name: SonarCloud | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | |
- name: SonarCloud Scan | |
uses: SonarSource/sonarcloud-github-action@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: manuc66/node-hp-scan-to | |
tags: | | |
# set latest tag for master branch | |
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'master') }} | |
type=raw,value=master,enable=${{ github.ref == format('refs/heads/{0}', 'master') }} | |
flavor: | | |
latest=auto | |
- name: Setup NodeJS | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '18' | |
cache: 'yarn' | |
- name: Install project dependencies | |
run: yarn | |
- name: Test | |
run: yarn test | |
- name: Build | |
run: yarn build | |
- name: cat build | |
run: cat src/commitInfo.json | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v3 | |
with: | |
push: ${{ startsWith(github.ref, 'refs/heads/') || startsWith(github.head_ref, 'refs/tags/') || startsWith(github.head_ref, 'refs/heads/feature') }} | |
platforms: linux/amd64,linux/arm/v7,linux/arm/v8,linux/arm64 | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |