Skip to content

Thinking about templ, my little cli tool #64

Thinking about templ, my little cli tool

Thinking about templ, my little cli tool #64

Workflow file for this run

name: Docker Image CI
on:
push:
branches: [ "main" ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
if: ${{ contains('playtechnique/websites', github.repository ) }}
steps:
- name: Checkout websites repository
uses: actions/checkout@v3
with:
ref: main
- name: Log in to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PAT }}
- name: Build and Publish the Docker image
uses: docker/build-push-action@v3
with:
push: true
tags: playtechnique/bloggo_not_doggo:latest
build-args: |
baseurl=playtechnique.io
deploy:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ansible
# Runs after the build job completes
# needs: "build"
if: ${{ contains('playtechnique/websites', github.repository ) }}
steps:
- name: Checkout websites repository
uses: actions/checkout@v3
with:
ref: main
- name: Install git-crypt
run: |
sudo apt-get install -y git-crypt
- name: decrypt
run: |
cd ..
echo ${{ secrets.GIT_CRYPT }} | base64 -d > git_crypt.key
git-crypt unlock git_crypt.key
cd -
- name: "set up ansible"
run: |
pip install ansible
- name: "Setup SSH Keys and known_hosts"
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: |
ssh-agent -a "${SSH_AUTH_SOCK}" > /dev/null
ssh-add - <<< "${{ secrets.DIGITAL_OCEAN_CI_SSH_KEY }}"
- name: "run ansible"
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: |
ansible-playbook -i inventory.yaml -vv -l droplets playbook.yaml