Skip to content

Commit

Permalink
flighdata-skyalps-gtfs: enable prod deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
dulvui committed Jun 19, 2023
1 parent b2a835d commit 5ef8577
Showing 1 changed file with 55 additions and 65 deletions.
120 changes: 55 additions & 65 deletions .github/workflows/ci-flighdata-skyalps-gtfs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ jobs:
if: github.ref == 'refs/heads/main'
needs: test
concurrency: deploy-test-flighdata-skyalps-gtfs
env:
DB_URL: ${{ secrets.DB_URL_TEST }}
DB_USER: ${{ secrets.DB_USER_TEST }}
DB_PWD: ${{ secrets.DB_PWD_TEST }}

steps:
- name: Checkout source code
uses: actions/checkout@v2
Expand Down Expand Up @@ -96,63 +91,58 @@ jobs:
project-name: ${{ env.PROJECT_NAME }}

# Deploy Prod
# deploy-prod-flighdata-skyalps-gtfs:
# runs-on: ubuntu-20.04
# if: github.ref == 'refs/heads/prod'
# needs: test
# concurrency: deploy-prod-flighdata-skyalps-gtfs
# env:
# DB_URL: ${{ secrets.DB_URL_PROD }}
# DB_USER: ${{ secrets.DB_USER_PROD }}
# DB_PWD: ${{ secrets.DB_PWD_PROD }}

# steps:
# - name: Checkout source code
# uses: actions/checkout@v2

# - name: Create .env file
# uses: noi-techpark/github-actions/env-file@v2
# with:
# working-directory: ${{ env.WORKING_DIRECTORY }}
# env:
# # General deployment options
# X_COMPOSE_PROJECT_NAME: ${{ env.PROJECT_NAME }}
# X_DOCKER_IMAGE: ${{ env.DOCKER_IMAGE }}
# X_DOCKER_TAG: ${{ env.DOCKER_TAG }}
# X_JAVA_OPTIONS: -Xms128m -Xmx512m

# X_ODH_BASE_URL: https://mobility.api.opendatahub.com

# X_AWS_ACCESS_KEY_ID: ${ secrets.AWS_S3_ACCESS_KEY_ID }
# X_AWS_ACCESS_SECRET_KEY: ${ secrets.AWS_S3_SECRET_ACCESS_KEY }
# X_AWS_BUCKET_NAME: flighdata-skyalps-gtfs-prod

# X_SCHEDULER_CRON: "0 0 */24 * * *"

# # Logging
# X_LOG_LEVEL: info
# X_LOG_STYLE: json

# - name: Build project
# uses: noi-techpark/github-actions/maven-build@v2
# with:
# working-directory: ${{ env.WORKING_DIRECTORY }}
# java-version: ${{ env.JAVA_VERSION }}
# build-command: "mvn -B -DskipTests -DfinalName=ROOT clean package"

# - name: Build and push images
# uses: noi-techpark/github-actions/docker-build-and-push@v2
# with:
# working-directory: ${{ env.WORKING_DIRECTORY }}/infrastructure
# docker-username: ${{ github.actor }}
# docker-password: ${{ secrets.GITHUB_TOKEN }}

# - name: Deploy application
# uses: noi-techpark/github-actions/docker-deploy@v2
# with:
# working-directory: ${{ env.WORKING_DIRECTORY }}/infrastructure/ansible
# hosts: "prod"
# ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
# docker-username: "noi-techpark-bot"
# docker-password: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
# project-name: ${{ env.PROJECT_NAME }}
deploy-prod-flighdata-skyalps-gtfs:
runs-on: ubuntu-20.04
if: github.ref == 'refs/heads/prod'
needs: test
concurrency: deploy-prod-flighdata-skyalps-gtfs
steps:
- name: Checkout source code
uses: actions/checkout@v2

- name: Create .env file
uses: noi-techpark/github-actions/env-file@v2
with:
working-directory: ${{ env.WORKING_DIRECTORY }}
env:
# General deployment options
X_COMPOSE_PROJECT_NAME: ${{ env.PROJECT_NAME }}
X_DOCKER_IMAGE: ${{ env.DOCKER_IMAGE }}
X_DOCKER_TAG: ${{ env.DOCKER_TAG }}
X_JAVA_OPTIONS: -Xms128m -Xmx512m

X_ODH_BASE_URL: https://mobility.api.opendatahub.com

X_AWS_ACCESS_KEY_ID: ${{ secrets.AWS_S3_ACCESS_KEY_ID }}
X_AWS_ACCESS_SECRET_KEY: ${{ secrets.AWS_S3_SECRET_ACCESS_KEY }}
X_AWS_BUCKET_NAME: flighdata-skyalps-gtfs-prod

X_SCHEDULER_CRON: "0 0 */24 * * *"

# Logging
X_LOG_LEVEL: info
X_LOG_STYLE: json

- name: Build project
uses: noi-techpark/github-actions/maven-build@v2
with:
working-directory: ${{ env.WORKING_DIRECTORY }}
java-version: ${{ env.JAVA_VERSION }}
build-command: "mvn -B -DskipTests -DfinalName=ROOT clean package"

- name: Build and push images
uses: noi-techpark/github-actions/docker-build-and-push@v2
with:
working-directory: ${{ env.WORKING_DIRECTORY }}/infrastructure
docker-username: ${{ github.actor }}
docker-password: ${{ secrets.GITHUB_TOKEN }}

- name: Deploy application
uses: noi-techpark/github-actions/docker-deploy@v2
with:
working-directory: ${{ env.WORKING_DIRECTORY }}/infrastructure/ansible
hosts: "prod"
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
docker-username: "noi-techpark-bot"
docker-password: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
project-name: ${{ env.PROJECT_NAME }}

0 comments on commit 5ef8577

Please sign in to comment.