This repository has been archived by the owner on Nov 1, 2023. It is now read-only.
chore: added archive notice to README #32
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tron Prod Build & Release | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
env: | |
APP_NAMESPACE: tron | |
jobs: | |
build-image: | |
name: Build & Push Docker Image | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set BUILD_TAG Variable | |
id: buildTag | |
run: echo "BUILD_TAG=$(date +'%Y%m%d')" >> $GITHUB_ENV | |
- name: Build and push | |
uses: docker/build-push-action@v2 | |
with: | |
push: true | |
tags: | | |
"${{ secrets.IMAGE_NAME }}:${{ env.BUILD_TAG }}" | |
"${{ secrets.IMAGE_NAME }}:latest" | |
- name: Image digest | |
run: echo ${{ steps.docker_build.outputs.digest }} | |
release-manifest: | |
name: Release Kubernetes Manifest | |
needs: 'build-image' | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
- name: 4lch4/Replace Tokens | |
id: replaceTokens | |
uses: 4lch4/replace-tokens@v1.1.0 | |
with: | |
files: manifest.yml | |
- name: Install Kubectl | |
uses: azure/setup-kubectl@v1 | |
id: install | |
- name: Kubernetes set context | |
uses: Azure/k8s-set-context@v1.1 | |
with: | |
method: kubeconfig | |
kubeconfig: ${{ secrets.KUBE_CONFIG }} | |
- name: Deploy to Kubernetes cluster | |
run: kubectl apply -f ./manifest.yml --namespace ${{ env.APP_NAMESPACE }} | |
# uses: Azure/k8s-deploy@v1.3 | |
# with: | |
# manifests: manifest.yml | |
# images: ${{ secrets.IMAGE_NAME }}:${{ env.BUILD_TAG }} | |
# imagePullSecrets: ${{ secrets.IMAGE_PULL_SECRET }} | |
# namespace: ${{ secrets.APP_NAMESPACE }} | |
# action: deploy | |
- uses: sarisia/actions-status-discord@v1 | |
if: always() | |
with: | |
webhook: ${{ secrets.DISCORD_WEBHOOK }} |