Skip to content

chore(ropecon2024): also detect finnish and english from language_other #492

chore(ropecon2024): also detect finnish and english from language_other

chore(ropecon2024): also detect finnish and english from language_other #492

Workflow file for this run

name: backend
on:
push:
paths:
- backend/**
- .github/workflows/backend.yaml
branches:
- main
pull_request:
paths:
- backend/**
- .github/workflows/backend.yaml
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
env:
DOCKER_BUILDKIT: "1"
COMPOSE_DOCKER_CLI_BUILD: "1"
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- run: docker compose -f docker-compose.test.yml up --exit-code-from test
working-directory: backend
build:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' }}
env:
SKAFFOLD_DEFAULT_REPO: ghcr.io/con2
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- id: cache-bin
uses: actions/cache@v3
with:
path: bin
key: ${{ runner.os }}-bin-2
- if: steps.cache-bin.outputs.cache-hit != 'true'
run: |
mkdir bin
curl -Lo bin/skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64
curl -Lo bin/kubectl https://dl.k8s.io/release/v1.22.0/bin/linux/amd64/kubectl
chmod +x bin/skaffold bin/kubectl
- run: echo "$PWD/bin" >> $GITHUB_PATH
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ secrets.GHCR_USERNAME }}
password: ${{ secrets.GHCR_PASSWORD }}
- uses: docker/setup-buildx-action@v3
- id: build
run: |
python3 -m pip install -U pip setuptools wheel
python3 -m pip install emskaffolden
emskaffolden -E staging -- build --file-output build.json
working-directory: backend
- uses: actions/upload-artifact@v3
with:
name: build-json
path: backend/build.json
# TODO DRY
deploy_staging:
runs-on: self-hosted
needs: build
environment: staging
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
with:
name: build-json
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- id: cache-bin
uses: actions/cache@v3
with:
path: bin
key: ${{ runner.os }}-bin-2
- if: steps.cache-bin.outputs.cache-hit != 'true'
run: |
mkdir bin
curl -Lo bin/skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64
curl -Lo bin/kubectl https://dl.k8s.io/release/v1.22.0/bin/linux/amd64/kubectl
chmod +x bin/skaffold bin/kubectl
- run: echo "$PWD/bin" >> $GITHUB_PATH
- run: |
python3 -m pip install -U pip setuptools wheel
python3 -m pip install emskaffolden
emskaffolden -E staging -- deploy -n kompassi-staging -a ../build.json
working-directory: backend
deploy_production:
runs-on: self-hosted
needs: build
environment: production
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
with:
name: build-json
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- id: cache-bin
uses: actions/cache@v3
with:
path: bin
key: ${{ runner.os }}-bin-2
- if: steps.cache-bin.outputs.cache-hit != 'true'
run: |
mkdir bin
curl -Lo bin/skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64
curl -Lo bin/kubectl https://dl.k8s.io/release/v1.22.0/bin/linux/amd64/kubectl
chmod +x bin/skaffold bin/kubectl
- run: echo "$PWD/bin" >> $GITHUB_PATH
- run: |
python3 -m pip install -U pip setuptools wheel
python3 -m pip install emskaffolden
emskaffolden -E production -- deploy -n kompassi-production -a ../build.json
working-directory: backend