log check #151
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/CD | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
deps: | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
node-version: [14.20.0] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: npm install, lint and/or test | |
run: | | |
yarn | |
env: | |
CI: true | |
build: | |
needs: deps | |
runs-on: ubuntu-20.04 | |
env: | |
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} | |
steps: | |
- | |
name: Check Out Repo | |
uses: actions/checkout@v2 | |
- | |
name: Login to Docker Hub | |
uses: docker/login-action@v1 | |
if: ${{env.DOCKERHUB_USERNAME != 0}} | |
with: | |
username: ${{secrets.DOCKERHUB_USERNAME}} | |
password: ${{secrets.DOCKERHUB_TOKEN}} | |
- | |
name: Build and push | |
id: docker_build | |
uses: docker/build-push-action@v2 | |
if: ${{env.DOCKERHUB_USERNAME != 0}} | |
with: | |
context: ./ | |
file: ./Dockerfile | |
push: true | |
tags: ecency/api:latest | |
- | |
name: Image digest | |
run: echo ${{ steps.docker_build.outputs.digest }} | |