Skip to content

fix docker ports | 2 #8

fix docker ports | 2

fix docker ports | 2 #8

Workflow file for this run

name: CI/CD
on:
push:
pull_request:
env:
PROJECT_NAME: sfscon-backend
DOCKER_IMAGE_CONFERENCES: ghcr.io/${{ github.repository }}/sfscon-conferences
DOCKER_IMAGE_PUSH_NOTIFICATIONS: ghcr.io/${{ github.repository }}/sfscon-push-notifications
DOCKER_IMAGE_TELEGRAM: ghcr.io/${{ github.repository }}/sfscon-telegram
jobs:
deploy-test:
runs-on: ubuntu-22.04
if: github.ref == 'refs/heads/main'
concurrency: deploy-test
env:
SERVER_PORT_CONFERENCES: 1005
SERVER_PORT_PUSH_NOTIFICATIONS: 1006
SERVER_PORT_TELEGRAM: 1007
DOCKER_TAG: ${{ github.sha }}-test
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Create .env file
uses: noi-techpark/github-actions/env-file@v2
with:
working-directory: ${{ env.WORKING_DIRECTORY }}
env:
X_SERVER_PORT_CONFERENCES: ${{ env.SERVER_PORT_CONFERENCES }}
X_SERVER_PORT_PUSH_NOTIFICATIONS: ${{ env.SERVER_PORT_PUSH_NOTIFICATIONS }}
X_SERVER_PORT_TELEGRAM: ${{ env.SERVER_PORT_TELEGRAM }}
X_DOCKER_IMAGE_CONFERENCES: ${{ env.DOCKER_IMAGE_CONFERENCES }}
X_DOCKER_IMAGE_PUSH_NOTIFICATIONS: ${{ env.DOCKER_IMAGE_PUSH_NOTIFICATIONS }}
X_DOCKER_IMAGE_TELEGRAM: ${{ env.DOCKER_IMAGE_TELEGRAM }}
X_DOCKER_TAG: ${{ env.DOCKER_TAG }}
- name: Build and push images
uses: noi-techpark/github-actions/docker-build-and-push@v2
with:
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: infrastructure/ansible
hosts: "test"
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:
# runs-on: ubuntu-22.04
# if: github.ref == 'refs/heads/prod'
# # needs: test
# concurrency: deploy-prod
# env:
# SERVER_PORT_CONFERENCES: 1005
# SERVER_PORT_PUSH_NOTIFICATIONS: 1006
# SERVER_PORT_TELEGRAM: 1007
# DOCKER_TAG: ${{ github.sha }}
# steps:
# - name: Checkout source code
# uses: actions/checkout@v4
#
# - name: Create .env file
# uses: noi-techpark/github-actions/env-file@v2
# with:
# working-directory: ${{ env.WORKING_DIRECTORY }}
# env:
# X_SERVER_PORT_CONFERENCE: ${{ env.SERVER_PORT_CONFERENCE }}
# X_SERVER_PORT_PUSH_NOTIFICATIONS: ${{ env.SERVER_PORT_PUSH_NOTIFICATIONS }}
# X_SERVER_PORT_TELEGRAM: ${{ env.SERVER_PORT_TELEGRAM }}
# X_DOCKER_IMAGE_CONFERENCES: ${{ env.DOCKER_IMAGE_CONFERENCES }}
# X_DOCKER_IMAGE_PUSH_NOTIFICATIONS: ${{ env.DOCKER_IMAGE_PUSH_NOTIFICATIONS }}
# X_DOCKER_IMAGE_TELEGRAM: ${{ env.DOCKER_IMAGE_TELEGRAM }}
# X_DOCKER_TAG: ${{ env.DOCKER_TAG }}
#
# - name: Build and push images
# uses: noi-techpark/github-actions/docker-build-and-push@v2
# with:
# 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: infrastructure/ansible
# hosts: "test"
# ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
# docker-username: "noi-techpark-bot"
# docker-password: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
# project-name: ${{ env.PROJECT_NAME }}