Skip to content

Merge pull request #1650 from dmitry-sinina/new_pg_images #590

Merge pull request #1650 from dmitry-sinina/new_pg_images

Merge pull request #1650 from dmitry-sinina/new_pg_images #590

name: Nigthly packages build
on:
push:
branches: [ master ]
jobs:
deb12:
name: Debian 12 nightly package building
runs-on: ubuntu-latest
container: ghcr.io/yeti-switch/yeti-web/build-image:bookworm
services:
db:
image: ghcr.io/yeti-switch/yeti-web/pgsql:16
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: set git safe directory
run: git config --global --add safe.directory '*'
- name: Build package
run: make package
env:
YETI_DB_HOST: db
YETI_DB_PORT: 5432
CDR_DB_HOST: db
CDR_DB_PORT: 5432
PACKAGE_TYPE: nightly
- name: Save deb package as artifact
uses: actions/upload-artifact@v4
with:
name: deb12-package
path: /__w/yeti-web/*.deb
- name: Upload package to ${{github.ref}} repo
env:
PKG_API_BASE: ${{secrets.PKG_API_BASE}}
run: ci/deploy.sh bookworm nightly main ../*.deb
- name: Setup deb-s3
run: gem install deb-s3
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
- name: Remove previous versions package from nightly repo
env:
AWS_ACCESS_KEY_ID: ${{secrets.DEB_AWS_ACCESS_KEY_ID}}
AWS_SECRET_ACCESS_KEY: ${{secrets.DEB_AWS_SECRET_ACCESS_KEY}}
AWS_ENDPOINT_URL: ${{secrets.DEB_AWS_ENDPOINT}}
run: |
deb-s3 delete yeti-web --arch=amd64 --bucket=${{secrets.DEB_AWS_BUCKET}} --prefix=nightly --codename=bookworm --component=main --visibility=nil --force-path-style --sign=B104E10C35895CFAC0F91473C8D3BC80B6F22179 --gpg-options "\-\-pinentry-mode=loopback \-\-no-tty \-\-batch \-\-yes \-\-passphrase ${{ secrets.GPG_PASSPHRASE }}"
deb-s3 clean --bucket=${{secrets.DEB_AWS_BUCKET}} --prefix=nightly --codename=bookworm --component=main --visibility=nil --force-path-style --sign=B104E10C35895CFAC0F91473C8D3BC80B6F22179 --gpg-options "\-\-pinentry-mode=loopback \-\-no-tty \-\-batch \-\-yes \-\-passphrase ${{ secrets.GPG_PASSPHRASE }}"
continue-on-error: true
- name: Upload package
env:
AWS_ACCESS_KEY_ID: ${{secrets.DEB_AWS_ACCESS_KEY_ID}}
AWS_SECRET_ACCESS_KEY: ${{secrets.DEB_AWS_SECRET_ACCESS_KEY}}
AWS_ENDPOINT_URL: ${{secrets.DEB_AWS_ENDPOINT}}
run: deb-s3 upload --bucket=${{secrets.DEB_AWS_BUCKET}} --prefix=nightly --codename=bookworm --component=main --visibility=nil --force-path-style --sign=B104E10C35895CFAC0F91473C8D3BC80B6F22179 --gpg-options "\-\-pinentry-mode=loopback \-\-no-tty \-\-batch \-\-yes \-\-passphrase ${{ secrets.GPG_PASSPHRASE }}" ../*.deb
deb12_container:
name: Debian 12 container
needs: deb12
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download a single artifact
uses: actions/download-artifact@v4
with:
name: deb12-package
- name: Display structure of downloaded files
run: ls -la
- name: Display path
run: pwd
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push to Docker Hub
uses: docker/build-push-action@v5
with:
context: .
file: ci/nightly-package.Dockerfile
push: true
tags: ghcr.io/yeti-switch/yeti-web:nightly-build