Skip to content

Update docker registry login run command #3

Update docker registry login run command

Update docker registry login run command #3

Workflow file for this run

name: publish
on:
push:
branches:
- main
env:
REGISTRY: ghcr.io
IMAGE_NAME: bitcoin-insights-frontend:latest
jobs:
build:
name: build angular app
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install Dependencies
run: npm install
- name: Build Angular App
run: npm run build --prod
publish:
name: Publish Docker Image
runs-on: ubuntu-latest
needs: build
steps:
- name: Login to Docker Registry
run: |
echo ${{ secrets.PAT }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Build Docker Image
run: |
docker build . --tag ${{ env.REGISTRY }}/${{ github.actor }}/${{ env.IMAGE_NAME }}
- name: Push Docker Image
run: |
docker push ${{ env.REGISTRY }}/${{ github.actor }}/${{ env.IMAGE_NAME }}
deploy:
name: Deploy Docker Image
runs-on: ubuntu-latest
needs: publish
steps:
- name: SSH into Deployment Server and Deploy
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
port: ${{ secrets.SSH_PORT }}
script: |
cd ${{ secrets.WORK_DIR }}
docker-compose pull
docker-compose up -d