Skip to content

Fixes misspel in deployment folder name #37

Fixes misspel in deployment folder name

Fixes misspel in deployment folder name #37

Workflow file for this run

name: Build and Deploy on Production
on: [ push ]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
environment: production
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
# - name: Build and push Docker image
# if: github.ref != 'refs/heads/master'
# uses: docker/build-push-action@v4
# with:
# context: .
# file: ./Dockerfile
# # platforms: linux/amd64,linux/arm64/v8
# push: true
# tags: ${{ secrets.DOCKER_HUB_USERNAME }}/tri-game:${{ github.sha }}
# cache-from: type=gha
# cache-to: type=gha,mode=max
- name: Build and push master Docker Image
# if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
# platforms: linux/amd64,linux/arm64/v8
push: true
tags: |
${{ secrets.DOCKER_HUB_USERNAME }}/tri-game:${{ github.sha }}
${{ secrets.DOCKER_HUB_USERNAME }}/tri-game:mb${{ github.run_number }}
${{ secrets.DOCKER_HUB_USERNAME }}/tri-game:latest
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Deploy to Production server
# if: github.ref == 'refs/heads/master'
uses: easingthemes/ssh-deploy@main
env:
SOURCE: "deployment/prod/"
TARGET: "deployment/tri-game/"
SSH_PRIVATE_KEY: ${{ secrets.SERVER_SSH_KEY }}
REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
REMOTE_USER: ${{ secrets.REMOTE_USER }}
SCRIPT_AFTER: |
whoami
ls -al
echo $RSYNC_STDOUT