update deletion of old registers #8
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: CI/CD Obscura Prod | |
# TODO | |
on: | |
push: | |
branches: | |
- "devops/create-develop-skaffold" | |
pull_request: | |
branches: | |
- production | |
types: | |
- closed | |
jobs: | |
build_and_deploy: | |
runs-on: | |
labels: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
with: | |
lfs: "true" | |
- name: Install Skaffold | |
run: | | |
curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64 | |
sudo install skaffold /usr/local/bin/ | |
shell: bash | |
- name: Install doctl | |
uses: digitalocean/action-doctl@v2 | |
with: | |
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} | |
- name: Log in to DigitalOcean Container Registry with short-lived credentials | |
run: doctl registry login --expiry-seconds 600 | |
- name: Cleanup old images | |
run: | | |
chmod +x "./cleanup-script.sh" | |
"./cleanup-script.sh" | |
- name: Save DigitalOcean kubeconfig | |
run: doctl kubernetes cluster kubeconfig save chicmoz-prod | |
- name: Deploy to cluster with Skaffold | |
run: skaffold run --filename k8s/production/skaffold.production.yaml |