Skip to content

Trying a change to the actions to update the manifests #35

Trying a change to the actions to update the manifests

Trying a change to the actions to update the manifests #35

name: Build and Publish Docker Image
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- 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@v4
with:
permissions: write-all
context: .
push: true
tags: ghcr.io/tylermarques/u-the-bomb-com:prod
update-manifests:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
repository: tylermarques/homelab-infra
ref: main
token: ${{ secrets.GITHUB_TOKEN }}
- name: Update Manifests
run: |
apt update && apt install -y yq
cd homelab-infra
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/prod/kustomization.yaml -i
git commit -am 'Increment image tag'
git commit -m "Update manifests"
git push