Skip to content

fix: PORT/HOST env vars + relative path??? #19

fix: PORT/HOST env vars + relative path???

fix: PORT/HOST env vars + relative path??? #19

Workflow file for this run

name: CI
concurrency:
group: ci
cancel-in-progress: true
on:
push:
branches: [ main ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
# Ensure latest version of git.
- name: Ensure latests version of git
run: |
sudo apt-get install -y software-properties-common \
&& sudo apt-get update \
&& sudo add-apt-repository -y ppa:git-core/ppa \
&& sudo apt-get update \
&& sudo apt-get install -y git
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
# Builds docker images and pushes them to GHCR
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ secrets.GHCR_USER }}
password: ${{ secrets.GHCR_TOKEN }}
- name: Build and push prod image
uses: docker/build-push-action@v4
with:
push: true
context: .
tags: ghcr.io/alanpq/website:latest, ghcr.io/alanpq/website:${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max
deploy:
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Deploy via ansible.
uses: alanpq/ansible-action@main
with:
tags: "web"
playbook: alanp.yml
host: ${{ secrets.HOST }}
user: ${{ secrets.USER }}
ssh_key: ${{ secrets.SSH_KEY }}
directory: ${{ secrets.DIRECTORY }}
vault_pass: ${{ secrets.VAULT_PASS }}