Testing deploys #10
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Deploy Docker Image | |
on: | |
push: | |
branches: | |
- docker | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Node and NPM | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.14.0 | |
- name: Install NPM Packages | |
run: npm ci | |
- name: Compile UI | |
run: npm run build:css && npm run build:brixi && npm run build:bundle && npm run build:js | |
- name: Build Docker image | |
run: docker build -t codewithkyle/divinedrop:prod . | |
- name: Save Docker image as tarball | |
run: docker save -o divinedrop.tar codewithkyle/divinedrop:prod | |
- name: Load SSH Key | |
uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.SSH_KEY }} | |
- name: Deploy | |
run: scp -o StrictHostKeyChecking=no ./divinedrop.tar ${{ secrets.USERNAME }}@${{ secrets.HOST }}:~/ | |
- name: Post Deployment | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.HOST }} | |
USERNAME: ${{ secrets.USERNAME }} | |
PORT: 22 | |
KEY: ${{ secrets.SSH_KEY }} | |
script: docker load -i ~/divinedrop.tar |