You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
1.4 KiB
62 lines
1.4 KiB
name: build
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Setup checkout
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Setup NodeJS v12
|
|
uses: actions/setup-node@v1
|
|
with:
|
|
node-version: 12
|
|
|
|
- name: Install Dependencies
|
|
run: yarn install
|
|
|
|
- name: ESlint check
|
|
run: yarn lint
|
|
|
|
docker:
|
|
needs: test
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Setup checkout
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Login to Docker Hub
|
|
uses: docker/login-action@v1.10.0
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
- name: Cache Docker layers
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: /tmp/.buildx-cache
|
|
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
|
restore-keys: |
|
|
${{ runner.os }}-buildx-
|
|
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
push: true
|
|
tags: guusvanmeerveld/portfolio:latest
|
|
cache-from: type=local,src=/tmp/.buildx-cache
|
|
cache-to: type=local,dest=/tmp/.buildx-cache
|
|
builder: ${{ steps.buildx.outputs.name }}
|
|
|
|
- name: Image digest
|
|
run: echo ${{ steps.docker_build.outputs.digest }}
|
|
|