chore: Update Docker image tag and file path in deploy-golang-develop… #32
Workflow file for this run
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: Lint, Test, Build and Deploy Dev golang | |
on: | |
push: | |
branches: ["develop", "feat/backend/deployment-and-up"] | |
paths: [ | |
"occupi-backend/cmd/**", | |
"occupi-backend/configs/**", | |
"occupi-backend/pkg/**", | |
"occupi-backend/.golangci.yml", | |
"occupi-backend/.dev.env.gpg", | |
"occupi-backend/tests/**", | |
".github/workflows/deploy-golang-develop.yml" | |
] | |
workflow_dispatch: | |
defaults: | |
run: | |
working-directory: occupi-backend | |
jobs: | |
deploy: | |
name: Deploy for Develop | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Copy files to VM | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.VM_IP }} | |
username: ${{ secrets.VM_USERNAME }} | |
key: ${{ secrets.VM_SSH_KEY }} | |
source: "occupi-backend/docker-compose.dev.yml,occupi-backend/Dockerfile.dev" | |
target: "/home/Y2KODELABS/occupi-backend-dev" | |
# SSH to VM and run commands | |
- name: SSH to VM | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.VM_IP }} | |
username: ${{ secrets.VM_USERNAME }} | |
key: ${{ secrets.VM_SSH_KEY }} | |
script: | | |
cd /home/Y2KODELABS/occupi-backend-dev/occupi-backend | |
echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin | |
DOCKER_USERNAME=${{ secrets.DOCKER_USERNAME }} docker compose -f docker-compose.dev.yml pull | |
DOCKER_USERNAME=${{ secrets.DOCKER_USERNAME }} docker compose -f docker-compose.dev.yml up -d |