fixed checkbox bug, resolved #49 #71
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: Publish and Deploy | |
on: | |
push: | |
branches: | |
- main | |
env: | |
SSH_USER: lhendrix | |
SSH_HOST: 51.68.188.78 | |
REGISTRY: ghcr.io | |
IMAGE_NAME: battmoteam/battmogui:latest | |
WORKDIR: battmogui | |
jobs: | |
publish: | |
name: publish image | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Login | |
run: echo ${{ secrets.PAT }} | docker login ghcr.io -u lorenah84 --password-stdin | |
- name: Build | |
run: | | |
docker-compose -f docker-compose-deploy.yml build | |
- name: Publish | |
run: docker-compose -f docker-compose-deploy.yml push | |
deploy: | |
name: Deploy image | |
runs-on: ubuntu-latest | |
needs: publish | |
steps: | |
- name: Install SSH keys | |
run: | | |
install -m 600 -D /dev/null ~/.ssh/id_rsa | |
echo "${{ secrets.ACTIONS_SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa | |
ssh-keyscan -H ${{ env.SSH_HOST }} >> ~/.ssh/known_hosts | |
- name: Test SSH Connection | |
run: ssh -o StrictHostKeyChecking=no ${{ env.SSH_USER }}@${{ env.SSH_HOST }} "echo SSH connection successful" | |
- name: Login to Registry | |
run: echo ${{ secrets.PAT }} | docker login ghcr.io -u lorenah84 --password-stdin | |
- name: Pull and Run Containers | |
run: | | |
ssh ${{ env.SSH_USER }}@${{ env.SSH_HOST }} "cd ${{ env.WORKDIR }} && \ | |
docker compose -f docker-compose.yml pull && \ | |
docker compose -f docker-compose.yml up -d" | |
- name: Cleanup | |
run: rm -rf ~/.ssh |