Merge pull request #319 from HebaruSan/feature/cli-analyze-mod #134
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: Deploy NetKAN-Infra | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
if: ${{ github.repository == 'KSP-CKAN/NetKAN-Infra' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Run tests before deploying | |
uses: docker/build-push-action@v2 | |
with: | |
context: ./netkan | |
file: ./netkan/Dockerfile | |
push: false | |
target: test | |
- name: Build and push NetKAN-infra | |
uses: docker/build-push-action@v2 | |
with: | |
context: ./netkan | |
file: ./netkan/Dockerfile | |
push: true | |
target: production | |
tags: kspckan/netkan:latest | |
webhooks: | |
if: ${{ github.repository == 'KSP-CKAN/NetKAN-Infra' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push webhooks-proxy | |
id: docker_build | |
uses: docker/build-push-action@v2 | |
with: | |
context: ./nginx | |
file: ./nginx/Dockerfile | |
push: true | |
tags: kspckan/webhooks-proxy:latest | |
deploy: | |
if: ${{ github.repository == 'KSP-CKAN/NetKAN-Infra' }} | |
runs-on: ubuntu-latest | |
needs: [ 'build', 'webhooks' ] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.7 | |
uses: actions/setup-python@v1 | |
with: | |
python-version: 3.7 | |
- name: Install Dependencies | |
run: | | |
pip install netkan/. | |
- name: Re-deploy Containers | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} | |
run: | | |
netkan redeploy-service --cluster NetKANCluster --service-name Indexer | |
netkan redeploy-service --cluster NetKANCluster --service-name Webhooks | |
netkan redeploy-service --cluster NetKANCluster --service-name Adder | |
netkan redeploy-service --cluster NetKANCluster --service-name Mirrorer | |
- name: CKAN repo dispatch | |
env: | |
REPO_ACCESS_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }} | |
if: env.REPO_ACCESS_TOKEN | |
uses: peter-evans/repository-dispatch@v2 | |
with: | |
repository: KSP-CKAN/CKAN | |
event-type: deploy | |
token: ${{ secrets.REPO_ACCESS_TOKEN }} |