Files
infra-hideyoshi.com/.github/workflows/deploy.yml

36 lines
974 B
YAML

name: remote ssh command
on:
repository_dispatch:
types:
- deploy
push:
branches:
- main
jobs:
deploy:
name: Deploy to Cluster
environment: ${{ github.ref_name == 'main' && 'prod' || 'staging' }}
runs-on: ubuntu-latest
timeout-minutes: 30
env:
NAMESPACE: ${{ vars.NAMESPACE }}
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Set Kubernetes Context
uses: azure/k8s-set-context@v1
with:
method: kubeconfig
kubeconfig: ${{ secrets.PORTFOLIO_KUBECONFIG }}
- name: Configures GHCR credentials
run: |
echo ${{ secrets.GHCR_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Execute deploy
run: |
./deploy.sh