Skip to content

Continuous Delivery #28

Continuous Delivery

Continuous Delivery #28

name: Continuous Delivery
on:
release:
types: [ published ]
jobs:
release:
name: Release Docker image
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Checkout source code
uses: actions/checkout@v4
- name: Log in to Docker Hub Container Registry
uses: docker/#-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image for release
env:
LINUX_AMD64_RELEASE: "true"
run: |
make release CHROME_VERSION=127.0.6533.119-1 GOTENBERG_VERSION=${{ github.event.release.tag_name }} DOCKER_REGISTRY=ghcr.io/fulll DOCKER_REPOSITORY=gotenberg
- name: generate aws credentials config
env:
AWS_CREDENTIALS: ${{ secrets.STAGING_AWS_CREDENTIALS }}
aws-region: eu-central-1
run: |
mkdir -p "${HOME}/.aws"
echo "${AWS_CREDENTIALS}" > "${HOME}/.aws/credentials"
- name: docker login and push
run: |
# Extract the tag name and strip the first letter using cut
TAG_NAME=$(echo "${{ github.event.release.tag_name }}" | cut -c 2-)
docker pull ghcr.io/fulll/gotenberg:${TAG_NAME}-cloudrun
docker tag ghcr.io/fulll/gotenberg:${TAG_NAME}-cloudrun 285715278780.dkr.ecr.eu-central-1.amazonaws.com/gotenberg-fulll:${TAG_NAME}-cloudrun
aws --region eu-central-1 ecr get-login-password | docker login --username AWS --password-stdin 285715278780.dkr.ecr.eu-central-1.amazonaws.com
docker tag 285715278780.dkr.ecr.eu-central-1.amazonaws.com/gotenberg-fulll:${TAG_NAME}-cloudrun 285715278780.dkr.ecr.eu-central-1.amazonaws.com/gotenberg-fulll:latest
docker push 285715278780.dkr.ecr.eu-central-1.amazonaws.com/gotenberg-fulll:${TAG_NAME}-cloudrun