Skip to content

Merge pull request #388 from adrianbielawski/fix-docker-deploy #870

Merge pull request #388 from adrianbielawski/fix-docker-deploy

Merge pull request #388 from adrianbielawski/fix-docker-deploy #870

Workflow file for this run

name: Build
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '16.x'
- name: Cache
uses: actions/cache@v4
with:
path: ~/.npm
key: npm-${{ hashFiles('**/package-lock.json') }}
- name: Install dependencies
run: npm ci
- name: Lint
run: npm run lint
- name: Format
run: npm run format
- name: Build
run: npm run build --if-present
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
- name: Store artifacts
uses: actions/upload-artifact@v4
with:
name: build
path: dist/
if-no-files-found: error
deploy:
if: github.event_name == 'push'
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Get artifacts
uses: actions/download-artifact@v4
with:
name: build
path: dist
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: docker.burek.it
username: ${{ secrets.BUREK_DOCKER_USERNAME }}
password: ${{ secrets.BUREK_DOCKER_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
push: true
context: .
tags: docker.burek.it/catalogues-frontend:latest