Skip to content

UI fixes in sponsor app #409

UI fixes in sponsor app

UI fixes in sponsor app #409

Workflow file for this run

name: Deploy
on:
push:
branches:
- main
- '2024'
- '2025'
workflow_dispatch:
jobs:
docker_image_build:
name: Docker image build
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 20.x
cache: 'yarn'
- name: Install dependencies
run: yarn install --immutable
- name: Build frontend web apps
run: yarn build --filter=admin... --filter=sponsor... --filter=web... --filter=app... --filter=admin-old...
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push docker image
uses: docker/build-push-action@v4
with:
context: .
file: ./apps/api/Dockerfile
push: true
tags: ghcr.io/${{ github.repository }}:${{ github.sha }},
ghcr.io/${{ github.repository }}:${{ github.ref_name }},
ghcr.io/${{ github.repository }}:${{ github.ref_name == 'main' && 'latest' || 'unstable' }}
cache-from: type=gha
cache-to: type=gha,mode=max
ansible_playbook:
name: Run Ansible playbook
runs-on: ubuntu-latest
needs:
- docker_image_build
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip'
cache-dependency-path: './infrastructure/ansible/requirements.txt'
- name: Install Ansible
run: |
pip install -r ./infrastructure/ansible/requirements.txt
- name: Install Ansible dependencies
run: |
ansible-galaxy install -r ./infrastructure/ansible/requirements.yml
- name: Setup sops
uses: mdgreenwald/[email protected]
- name: Login to AWS
run: |
aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }} --profile ddays-app
aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }} --profile ddays-app
- name: Get Prometheus server IP
id: get-ip
run: |
IP=$(aws ec2 describe-instances \
--region eu-central-1 \
--profile ddays-app \
--filters "Name=tag:Project,Values=dump-monitoring" "Name=tag:Environment,Values=production" \
--query 'Reservations[0].Instances[0].PublicIpAddress' \
--output text)
echo "prometheus_ip=$IP" >> $GITHUB_OUTPUT
- name: Run Ansible playbook
run: |
eval $(ssh-agent)
./infrastructure/scripts/ansible-playbook.sh ${{ github.ref_name == 'main' && 'production' || github.ref_name }} api
env:
prometheus_ip: ${{ steps.get-ip.outputs.prometheus_ip }}