Some checks failed
Build the portfolio website / build-portfolio-website (push) Failing after 1m16s
49 lines
1.1 KiB
YAML
49 lines
1.1 KiB
YAML
name: Build the portfolio website
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- master
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
build-portfolio-website:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v2
|
|
with:
|
|
node-version: "20"
|
|
|
|
- name: Install dependencies
|
|
run: cd frontend && npm install
|
|
|
|
- name: Build the project
|
|
run: cd frontend && npm run build
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
with:
|
|
config-inline: |
|
|
[${{ secrets.DOCKER_REGISTRY }}]
|
|
|
|
- name: Login to Docker registry
|
|
uses: docker/login-action@v2
|
|
with:
|
|
registry: ${{ secrets.DOCKER_REGISTRY }}
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: Build Docker image
|
|
uses: docker/build-push-action@v4
|
|
with:
|
|
context: .
|
|
file: Dockerfile
|
|
push: true
|
|
tags: ${{ secrets.DOCKER_REGISTRY }}/my-portfolio:latest
|