wip: add ci

This commit is contained in:
Jayden Pyles
2024-06-26 16:06:01 -05:00
parent a160a6d127
commit 3ca17a930e
4 changed files with 36 additions and 2 deletions
+26
View File
@@ -0,0 +1,26 @@
name: ci
on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/${{secrets.DOCKERHUB_REPO}}:latest
+7
View File
@@ -43,3 +43,10 @@ up-dev:
down:
$(COMPOSE_DEV) down
$(COMPOSE_PROD) down
setup:
ansible-playbook -i ./ansible/inventory.yaml ./ansible/setup.yaml
deploy:
ansible-playbook -i ./ansible/inventory.yaml ./ansible/deploy_site.yaml
+1
View File
@@ -1,2 +1,3 @@
github_repo: https://github.com/jaypyles/webapp-template.git
deploy_path: /home/admin/website
deploy_command: make pull up-prd
+2 -2
View File
@@ -4,7 +4,7 @@
vars_files:
- ./config.yaml
tasks:
- name: Run make pull up
command: make pull up
- name: Deploy
command: "{{deploy_command}}"
args:
chdir: "{{deploy_path}}"