Skip to content

Add parse markdown #29 #59

Add parse markdown #29

Add parse markdown #29 #59

Workflow file for this run

name: CI/CD
on: [ pull_request, push ]
env:
REGISTRY: ghcr.io
IMAGE_NAME: ghcr.io/${{ github.repository }}
jobs:
preflight:
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Running hadolint
uses: hadolint/hadolint-action@v2.1.0
with:
dockerfile: devops/docker/Dockerfile
- name: Running yaml lint
uses: "docker://pipelinecomponents/yamllint:0.21.1"
with:
args: yamllint .
- name: Running shellcheck
uses: "docker://pipelinecomponents/shellcheck:0.11.4"
with:
args: bash -c "find . -name \*.sh -type f -print0 | xargs -0 -P $(nproc) -r -n1 shellcheck"
build:
runs-on: ubuntu-20.04
needs: preflight
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.IMAGE_NAME }}
tags: |
type=sha,priority=300
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
- name: Build production and push Docker image
uses: docker/build-push-action@v3
with:
context: .
file: devops/docker/Dockerfile
push: ${{ github.ref == 'refs/heads/main' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=${{ env.IMAGE_NAME }}:_buildcache
cache-to: type=registry,ref=${{ env.IMAGE_NAME }}:_buildcache,mode=max
outputs:
tag: ${{ steps.meta.outputs.version }}
deploy:
runs-on: ubuntu-20.04
needs: build
if: ${{ github.ref == 'refs/heads/main' }}
steps:
- name: Deploy
run: curl -k -X POST -d "component=${{ secrets.DEPLOYER_COMPONENT }}&key=${{ secrets.DEPLOYER_KEY }}&tag=${{ needs.build.outputs.tag }}" ${{ secrets.DEPLOYER_HOST }}