Skip to content

CI for preprod

CI for preprod #46

Workflow file for this run

on: workflow_dispatch
name: CI for preprod
jobs:
build-push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build the docker images
run: make CONTINUE=y build-prod
- name: Test running the docker containers
run: |
make CONTINUE=y up-prod
./infra/scripts/test-alive.sh localhost
make down-prod
- name: Login to GHCR
if: success()
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push on GHCR
if: success()
run: |
make push
make push-develop
- name: Delete untagged images
uses: vlaurin/action-ghcr-prune@main
with:
token: ${{ secrets.PERSO_ACCESS_TOKEN }}
organization: datalab-mi
container: basegun/basegun-backend
dry-run: false
untagged: true
- name: Delete untagged images
uses: vlaurin/action-ghcr-prune@main
with:
token: ${{ secrets.PERSO_ACCESS_TOKEN }}
organization: datalab-mi
container: basegun/basegun-frontend
dry-run: false
untagged: true
deploy-preprod:
uses: ./.github/workflows/deploy.yml
needs: build-push
with:
image_version: "develop"
branch: ${{ github.ref_name }}
volume_size: 10
flavor: "s1-2"
workspace: "preprod"
secrets:
API_OVH_TOKEN: ${{ secrets.API_OVH_TOKEN }}
SERVER_IP: ${{ secrets.PREPROD_SERVER_IP }}
OS_PASSWORD: ${{ secrets.OS_PASSWORD }}
OS_PROJECT_ID: ${{ secrets.OS_PROJECT_ID }}
OS_PROJECT_NAME: ${{ secrets.OS_PROJECT_NAME }}
OS_USERNAME: ${{ secrets.OS_USERNAME }}
X_OVH_TOKEN: ${{ secrets.PREPROD_OVH_TOKEN }}
test:
runs-on: ubuntu-latest
needs: deploy-preprod
steps:
- uses: actions/checkout@v2
- name: Test DNS
if: success()
run : |
./infra/scripts/test-alive.sh preprod.basegun.fr