Skip to content

feat: switch out mdx for markdown for now... #190

feat: switch out mdx for markdown for now...

feat: switch out mdx for markdown for now... #190

name: Build Container Image and Release
on:
push:
branches: [ main, refactor-nextjs-sqlite ]
workflow_run:
workflows: ["Playwright Tests"]
branches: [main, refactor-nextjs-sqlite]
types:
- completed
env:
IMAGE_NAME: $GITHUB_RUN_ID
jobs:
build-and-push-container-image:
runs-on: ubuntu-latest
# if: ${{ github.event.workflow_run.conclusion == 'success' }}
permissions:
packages: write
contents: read
outputs:
IMAGE_TAG: ${{ env.IMAGE_TAG }}
steps:
- uses: actions/checkout@v3
- name: Add SHORT_SHA env property with commit short sha
run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV
- name: Add IMAGE_TAG env
run: echo "IMAGE_TAG=${{ github.run_id }}-${{ env.SHORT_SHA }}" >> $GITHUB_ENV
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
- name: Build and Push Image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ghcr.io/${{ github.repository }}:latest,ghcr.io/${{ github.repository }}:${{ env.IMAGE_TAG }}
cache-from: type=gha
cache-to: type=gha,mode=max
deploy-release:
runs-on: ubuntu-latest
needs: [build-and-push-container-image]
concurrency: production
environment:
name: production
steps:
- uses: actions/checkout@v3
- name: Deploy
uses: WyriHaximus/github-action-helm3@v3
with:
exec: >
helm --namespace=ncrmro-com upgrade --install ncrmro-com ./chart
--wait --atomic --set image.tag=${{ needs.build-and-push-container-image.outputs.IMAGE_TAG }}
--values chart/values.production.yaml
kubeconfig: '${{ secrets.KUBECONFIG }}'