42 lines
1.2 KiB
YAML
42 lines
1.2 KiB
YAML
name: Build and deploy project
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
env:
|
|
CONTAINER_REGISTRY: schmelczera
|
|
|
|
jobs:
|
|
build-project:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout current branch with lfs
|
|
uses: actions/checkout@master
|
|
with:
|
|
lfs: true
|
|
- name: Build project
|
|
run: |
|
|
npm install
|
|
npm run initialize
|
|
npm run build
|
|
- name: Deploy frontend
|
|
uses: w9jds/firebase-action@master
|
|
with:
|
|
args: deploy --only hosting --project decla-red
|
|
env:
|
|
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
|
|
PROJECT_PATH: frontend
|
|
- name: Authenticate with dockerhub
|
|
run: |
|
|
docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASSWORD }}
|
|
- name: Install buildx
|
|
id: buildx
|
|
uses: crazy-max/ghaction-docker-buildx@v1
|
|
with:
|
|
version: latest
|
|
- name: Build and push server image
|
|
run: |
|
|
docker buildx build \
|
|
--tag $CONTAINER_REGISTRY/declared-server:latest \
|
|
--platform linux/amd64,linux/arm/v7,linux/arm64 . --push
|
|
working-directory: backend
|