Skip to content

Workflow file for this run

name: Build and push to Github container registry
on:
push:
branches: ['main']
pull_request:
branches: ['main']
jobs:
build:
# Defines the type of runner the job runs on
runs-on: ubuntu-latest
steps:
- name: Checkout to the repository
uses: actions/checkout@v3
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_HEXCORE_KEY }}
known_hosts: 'placeholder'
- name: Genetate auth known_hosts
run: ssh-keyscan -t rsa ${{ secrets.SSH_HOST }} >> ~/.ssh/known_hosts
- run: rsync --archive --verbose --compress --progress . ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:~/
# - name: Set up NodeJS environment
# uses: actions/setup-node@v2
# with:
# # Reads the node version from the .nvmrc file itself
# # node-version-file: '.nvmrc'
# # The node version can be hard-coded
# cache: 'yarn'
# cache-dependency-path: client/yarn.lock
# node-version: 16
# - name: Install client`s package dependencies
# working-directory: ./client
# run: yarn install
# - name: Create client`s test build
# working-directory: ./client
# run: yarn build
# # Run test cases and this could ensure minimum coverage as well if set
# - name: Execute client`s test cases
# working-directory: ./client
# run: yarn test
# - name: Build image and save it as tar
# run: |
# docker build . -t piekerp:latest
# docker save -o piekerp-latest.tar piekerp:latest
# - name: Send tar image to the prod host machine using rsync
# uses: burnett01/[email protected]
# with:
# switches: -avzr --delete
# remote_path: ~/temp/
# remote_host: ${{ secrets.SSH_HOST }}
# remote_user: ${{ secrets.SSH_USER }}
# remote_key: ${{ secrets.SSH_HEXCORE_KEY }}
# - name: Login to Github container registry
# uses: docker/login-action@v2
# with:
# registry: ghcr.io
# username: ${{ github.actor }}
# password: ${{ secrets.CR_TOKEN }}
# - name: Push image to Github container registry
# uses: docker/build-push-action@v2
# with:
# context: .
# file: ./Dockerfile
# push: true
# tags: ghcr.io/${{ github.repository }}:latest