-
-
Notifications
You must be signed in to change notification settings - Fork 16
89 lines (87 loc) · 2.56 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
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@v6
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@v6
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 }}