Build and Deploy Release #676
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 and Deploy Release | |
on: | |
release: | |
types: | |
- published | |
workflow_run: | |
branches: | |
- "main" | |
types: | |
- completed | |
workflows: | |
- "Build" | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'release' }} | |
permissions: | |
id-token: write | |
contents: read | |
packages: read | |
actions: read | |
checks: read | |
deployments: read | |
issues: read | |
discussions: read | |
pages: read | |
pull-requests: read | |
repository-projects: read | |
statuses: read | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Download artifact | |
id: download-artifact | |
uses: dawidd6/action-download-artifact@v5 | |
with: | |
workflow: build.yml | |
workflow_conclusion: success | |
name: tapir | |
path: target/quarkus-app | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: ${{ secrets.AWS_IAM_ROLE_ARN }} | |
aws-region: eu-central-1 | |
- name: Login to Amazon ECR Public | |
uses: aws-actions/amazon-ecr-login@v2 | |
id: login-ecr-public | |
env: | |
AWS_REGION: us-east-1 | |
AWS_DEFAULT_REGION: us-east-1 | |
with: | |
registry-type: public | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
pacovk/tapir | |
${{ steps.login-ecr-public.outputs.registry }}/o7d8p0l2/tapir | |
tags: | | |
type=raw,value=latest,enable={{is_default_branch}} | |
type=schedule,pattern=nightly | |
type=ref,event=branch | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}} | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
env: | |
AWS_REGION: us-east-1 | |
AWS_DEFAULT_REGION: us-east-1 | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm64 | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |