Merge pull request #967 from Wheezy049/feat/newsletter-subcription #40
This file contains 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 Upload | |
on: | |
push: | |
branches: | |
- dev | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
if: github.event.repository.fork == false | |
environment: | |
name: "dev" | |
url: ${{ vars.URL }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build Docker image | |
run: docker build -t hngdevops/nextjs-boilerplate:dev -f docker/development/Dockerfile . | |
- name: Save and compress Docker image | |
run: | | |
docker save hngdevops/nextjs-boilerplate:dev > nextjs-dev.tar | |
gzip nextjs-dev.tar | |
- name: Copy to server | |
uses: appleboy/scp-action@master | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USERNAME }} | |
password: ${{ secrets.PASSWORD }} | |
source: "nextjs-dev.tar.gz" | |
target: "/tmp/nextjs" | |
- name: Load image in server | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USERNAME }} | |
password: ${{ secrets.PASSWORD }} | |
script: | | |
cd /tmp/nextjs | |
gunzip nextjs-dev.tar.gz | |
docker load < nextjs-dev.tar | |
rm -f nextjs-dev.tar |