mirror of
https://github.com/ChristianLempa/boilerplates.git
synced 2024-12-25 08:28:59 +01:00
Add GitHub Actions to boilerplates
This commit is contained in:
parent
cb194d6b1a
commit
6a3edd6e5e
22
github-actions/kubectl/kubernetes-deploy.yml
Normal file
22
github-actions/kubectl/kubernetes-deploy.yml
Normal file
@ -0,0 +1,22 @@
|
||||
name: Kubernetes Deploy
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
env:
|
||||
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }}
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: your-runner
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Deploy Manifest
|
||||
uses: actions-hub/kubectl@master
|
||||
with:
|
||||
args: apply -f your-manifest.yml
|
26
github-actions/scp-action/copy-config-files.yml
Normal file
26
github-actions/scp-action/copy-config-files.yml
Normal file
@ -0,0 +1,26 @@
|
||||
name: copy config files to remote machine
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- 'config/**'
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: your-runner
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Upload new Config Files
|
||||
uses: appleboy/scp-action@master
|
||||
with:
|
||||
username: your-username
|
||||
host: your-host
|
||||
key: ${{ secrets.your-private-ssh-key }}
|
||||
source: './config/*'
|
||||
target: '/target/path/'
|
||||
strip_components: 1 # remove the top level directory
|
31
github-actions/ssh-action/restart-docker.yml
Normal file
31
github-actions/ssh-action/restart-docker.yml
Normal file
@ -0,0 +1,31 @@
|
||||
name: Update Docker Compose File
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- 'docker-compose.yml'
|
||||
|
||||
env:
|
||||
YOUR-ENV-SECRET: ${{ secrets.YOUR-ENV-SECRET }}
|
||||
YOUR-ENV-VAR: ${{ vars.YOUR-ENV-VAR }}
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: your-runner
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Restart Docker Container
|
||||
uses: fifsky/ssh-action@master
|
||||
with:
|
||||
user: your-user
|
||||
host: your-host
|
||||
key: ${{ secrets.your-private-ssh-key }}
|
||||
command: |
|
||||
cd your-compose-project-directory
|
||||
export YOUR-ENV-SECRET=${{ secrets.YOUR-ENV-SECRET }}
|
||||
export YOUR-ENV-VAR=${{ vars.YOUR-ENV-VAR }}
|
||||
docker-compose up -d --force-recreate
|
Loading…
Reference in New Issue
Block a user