Update secrets naming #2
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 Deploy on Push | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
- name: Log in to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Build and Push Docker Image | |
run: | | |
COMMIT_HASH=$(echo $GITHUB_SHA | cut -c1-7) | |
docker buildx build --platform linux/amd64,linux/arm64 \ | |
-t devinfritz/vzbot-web-nuxt:stage-${COMMIT_HASH} --push . | |
- name: SSH and Execute Commands | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.SERVER_HOST }} | |
username: ${{ secrets.SERVER_USERNAME }} | |
key: ${{ secrets.SERVER_SSH_KEY }} | |
passphrase: ${{ secrets.SERVER_SSH_PASSPHRASE }} | |
port: ${{ secrets.SERVER_SSH_PORT }} | |
script: | | |
echo "Starting deployment" | |
# Add your deployment commands here | |
echo "Deployment complete" |