Skip to content

Build and deploy container (Production) #19

Build and deploy container (Production)

Build and deploy container (Production) #19

name: Build and deploy container (Production)
on:
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
runs-on: ubuntu-latest
steps:
# Setup environment
- uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-$latest
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to DockerHub
uses: docker/login-action@v2
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-new
cache-from: type=local,src=/tmp/.buildx-cache
push: true
tags: |
${{ vars.REGISTRY_REPO_PATH }}:latest
# Clean up cache
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
deploy:
uses: ./.github/workflows/deploy-kubernetes.yml
needs: build
with:
environment: production
values_file: production
release_name: production-bot
secrets: inherit