Skip to content

Build and publish ubuntu-22.04-userver images #144

Build and publish ubuntu-22.04-userver images

Build and publish ubuntu-22.04-userver images #144

name: Build and publish ubuntu-22.04-userver images
'on':
schedule:
- cron: '30 5 * * 0' # Every Sunday at 5:30
workflow_dispatch:
release:
types: [published]
jobs:
build_and_publish:
runs-on: ubuntu-22.04
name: Build and publish images
permissions:
contents: read
packages: write
env:
USERVER_IMAGE_TAG: ${{ github.event.release.tag_name || 'latest' }}
steps:
- uses: actions/checkout@v5
- name: Free disk space
run: |
df -h
# See https://stackoverflow.com/questions/75536771/github-runner-out-of-disk-space-after-building-docker-image
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /usr/lib/php* /opt/ghc \
/usr/local/share/powershell /usr/share/swift /usr/local/.ghcup \
/opt/hostedtoolcache/CodeQL || true
sudo docker image prune --all --force
df -h
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build the ubuntu-22.04-userver Docker image
run: |
docker build -t ghcr.io/userver-framework/ubuntu-22.04-userver:${USERVER_IMAGE_TAG} -f scripts/docker/ubuntu-22.04.dockerfile .
docker push ghcr.io/userver-framework/ubuntu-22.04-userver:${USERVER_IMAGE_TAG}
- name: Build the ubuntu-22.04-userver-pg Docker image
run: |
docker build -t ghcr.io/userver-framework/ubuntu-22.04-userver-pg:${USERVER_IMAGE_TAG} -f scripts/docker/ubuntu-22.04-pg.dockerfile .
docker push ghcr.io/userver-framework/ubuntu-22.04-userver-pg:${USERVER_IMAGE_TAG}
- name: Build the ubuntu-22.04-userver-pg-dev Docker image
run: |
docker build -t ghcr.io/userver-framework/ubuntu-22.04-userver-pg-dev:${USERVER_IMAGE_TAG} -f scripts/docker/ubuntu-22.04-pg-dev.dockerfile .
docker push ghcr.io/userver-framework/ubuntu-22.04-userver-pg-dev:${USERVER_IMAGE_TAG}