Update main.yaml
This commit is contained in:
parent
19e51639b4
commit
b5b643d4a9
1 changed files with 35 additions and 5 deletions
40
.github/workflows/main.yaml
vendored
40
.github/workflows/main.yaml
vendored
|
|
@ -1,23 +1,53 @@
|
||||||
name: Deploy site
|
name: Build and deploy project
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
env:
|
||||||
|
CONTAINER_REGISTRY: schmelczera
|
||||||
|
DOMAIN: '174.138.103.56'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
firebase-deploy:
|
build-project:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout current branch with lfs
|
- name: Checkout current branch with lfs
|
||||||
uses: actions/checkout@master
|
uses: actions/checkout@master
|
||||||
- name: Build site
|
with:
|
||||||
|
lfs: true
|
||||||
|
- name: Build project
|
||||||
run: |
|
run: |
|
||||||
npm install
|
npm install
|
||||||
|
npm run initialize
|
||||||
npm run build
|
npm run build
|
||||||
working-directory: frontend
|
- name: Deploy frontend
|
||||||
- name: Deploy html
|
|
||||||
uses: w9jds/firebase-action@master
|
uses: w9jds/firebase-action@master
|
||||||
with:
|
with:
|
||||||
args: deploy --only hosting --project decla-red
|
args: deploy --only hosting --project decla-red
|
||||||
env:
|
env:
|
||||||
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
|
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
|
||||||
PROJECT_PATH: frontend
|
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/decla-red-server:latest \
|
||||||
|
--platform linux/amd64,linux/arm/v7,linux/arm64 . --push
|
||||||
|
working-directory: backend
|
||||||
|
- name: Setup auth tokens
|
||||||
|
run: |
|
||||||
|
mkdir ~/.ssh
|
||||||
|
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
|
||||||
|
chmod 400 ~/.ssh/id_ed25519
|
||||||
|
ssh -o StrictHostKeyChecking=no root@$DOMAIN uptime
|
||||||
|
- name: Stack deploy
|
||||||
|
run: |
|
||||||
|
DOCKER_HOST=ssh://root@$DOMAIN docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
DOCKER_HOST=ssh://root@$DOMAIN docker stack deploy cluster -c cluster-stack.yml --with-registry-auth
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue