Skip to content

Slightly better error handling #8

Slightly better error handling

Slightly better error handling #8

Workflow file for this run

name: Release
on:
push:
branches: [ main ]
env:
REPO: ${{ github.event.repository.name }}
IMAGE_BASE: ${{ secrets.DOCKER_REGISTRY }}/${{ github.event.repository.name }}
jobs:
build:
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.tag.outputs.new_tag }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Generate new tag
id: tag
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
tag_prefix: ''
- name: Login to container registry
uses: docker/login-action@v3
with:
registry: ${{ secrets.DOCKER_REGISTRY }}
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- name: Build and publish image
env:
IMAGE_NAME: "${{ env.IMAGE_BASE }}:${{ steps.tag.outputs.new_tag }}"
run: |
docker build -t ${IMAGE_NAME} .
docker push ${IMAGE_NAME}
release:
needs: build
runs-on: on-prem
environment: 'Prod'
steps:
- name: Perform rolling update
run: |
kubectl -n default set image deploy/${REPO} ${REPO}=${IMAGE_BASE}:${{ needs.build.outputs.tag }}
kubectl -n default rollout status deploy/${REPO}