Release unleash-edge v19.1.0 #198
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Build Release - docker image for Github, DockerHub and AWS public gallery | |
on: | |
workflow_dispatch: | |
push: | |
paths: | |
- "**/*.rs" | |
- "**/*.toml" | |
- ".github/workflows/build-docker-release.yaml" | |
tags: | |
- unleash-edge-v[0-9]+.* | |
permissions: | |
id-token: write | |
contents: read | |
packages: write | |
jobs: | |
dockerpublish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install rust | |
run: | | |
rustup set auto-self-update disable | |
rustup toolchain install stable --profile default | |
rustup show | |
- name: Rust cache | |
uses: Swatinem/rust-cache@v2 | |
with: | |
prefix-key: "rust-v0-gnu" | |
- name: Install cross (cross compile) | |
run: | | |
cargo install cross | |
- name: Build release for x86_64 | |
run: | | |
cargo build --release --target=x86_64-unknown-linux-gnu | |
- name: Build release for aarch64 | |
run: | | |
cross build --release --target=aarch64-unknown-linux-gnu | |
- name: Setup docker buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: arn:aws:iam::726824350591:role/unleash-github-ecr-public-publish-role | |
role-session-name: edge-actions-push-to-ecr-public | |
aws-region: us-east-1 | |
- name: Login to AWS ECR | |
id: login-ecr-public | |
uses: aws-actions/amazon-ecr-login@v2 | |
with: | |
registry-type: public | |
- name: Docker meta configuration (set image and tag) | |
uses: docker/metadata-action@v5 | |
id: meta | |
with: | |
images: | | |
unleashorg/unleash-edge | |
ghcr.io/Unleash/unleash-edge | |
${{ steps.login-ecr-public.outputs.registry }}/unleashorg/unleash-edge | |
tags: | | |
type=match,pattern=unleash-edge-v(\d+\.\d+.\d+),group=1,prefix=v | |
type=match,pattern=unleash-edge-v(\d+\.\d+).*,group=1,prefix=v | |
- name: Login to docker hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Login to Github Container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build tag and push images | |
uses: docker/build-push-action@v5 | |
with: | |
file: Dockerfile.publish | |
context: . | |
platforms: linux/arm64,linux/amd64 | |
push: true | |
labels: ${{ steps.meta.outputs.labels }} | |
tags: ${{ steps.meta.outputs.tags }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max |