Skip to content

oops forgot to change to dev #49

oops forgot to change to dev

oops forgot to change to dev #49

name: Build and Publish Docker Image
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
environment: github-actions
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ghcr.io/tylermarques/u-the-bomb-com:${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max
update-manifests:
needs: build
runs-on: ubuntu-latest
environment: github-actions
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
repository: tylermarques/homelab-infra
ref: main
token: ${{ secrets.HOMELAB_GITHUB_PAT }}
path: homelab-infra/
- name: Update Manifests
run: |
cd homelab-infra
ls -lha
apt update && apt install -y yq
git config --global user.name "GitHub Actions"
git config --global user.email "actions@github.com"
yq e '(.images[] | select(.name == "u-the-bomb-com") | .newTag) = "'${{ github.sha }}'"' apps/u-the-bomb-com/production/kustomization.yaml -i
git commit -am 'Push from ${{ github.actor }} to ${{ github.repository }}'
git push